Answers: <p>I believe both options are viable routes, but my preference is for <strong>Option 1</strong> as I like having the &quot;deploy plan&quot; to be only concerned with starting a container using the built image.</p>
  
Answers: CC BY-SA 4.0
Answers: 2020-10-30T15:22:32.960Z
Answers: 2020-10-30T15:22:32.960Z
Answers: Derek Pedersen
Body: <p>We are using Bamboo to build and deploy a number of Java web applications. Right now, the Build Plans generally produce a WAR file, which is deployed by the Deploy Plans. We are moving our hosting (and building) to docker, and I'm unclear on the best way to handle this in Bamboo. Specifically, I'm unsure of whether the Build Plan or Deploy Plan should be responsible for generating a docker image.</p>
  <h3>Option 1</h3>
  <ul>
  <li>The Bamboo build plan does a multi-stage Docker build to tag and publish a docker image (~ 300MB)</li>
  <li>The Bamboo deploy plan is responsible for spinning up a container for that image.</li>
  </ul>
  <h3>Option 2</h3>
  <ul>
  <li>The Bamboo build plan does a Docker build, and attaches the artifact (WAR file ~ 80 MB)</li>
  <li>The Bamboo deploy plan is responsible for creating an image, inserting the WAR file, and spinning up a container</li>
  </ul>
  <p>Just wondering if there is a standard or best practice pattern here. Or am I thinking about this wrong? Are there other options I should be considering?</p>
  
Tags: <docker><deployment><build-pipeline><bamboo>
Title: What part of the Bamboo pipeline should generate a Docker image?
UserDisplayName: Eric
ThreadText: # What part of the Bamboo pipeline should generate a Docker image?
  
  (Asked by: username_0 on 2020-10-20)
  
  We are using Bamboo to build and deploy a number of Java web applications. Right now, the Build Plans generally produce a WAR file, which is deployed by the Deploy Plans. We are moving our hosting (and building) to docker, and I'm unclear on the best way to handle this in Bamboo. Specifically, I'm unsure of whether the Build Plan or Deploy Plan should be responsible for generating a docker image.
  
  ### Option 1
  
  * The Bamboo build plan does a multi-stage Docker build to tag and publish a docker image (~ 300MB)
  * The Bamboo deploy plan is responsible for spinning up a container for that image.
  
  ### Option 2
  
  * The Bamboo build plan does a Docker build, and attaches the artifact (WAR file ~ 80 MB)
  * The Bamboo deploy plan is responsible for creating an image, inserting the WAR file, and spinning up a container
  
  Just wondering if there is a standard or best practice pattern here. Or am I thinking about this wrong? Are there other options I should be considering?
  
  **Tags:** docker, deployment, build-pipeline, bamboo
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-10-30. Score: 1
  
  I believe both options are viable routes, but my preference is for **Option 1** as I like having the "deploy plan" to be only concerned with starting a container using the built image.
  
  
  ---
  
  