Building a Docker image in Bamboo
In Bamboo, you can build a Docker image based on the specified Dockerfile. The Dockerfile may be provided as an existing file in the task's working directory or defined in the task configuration.
The image is stored in Docker's local image installation directory and can be used by subsequent Docker tasks in the job. You can optionally save the image to a file in the working directory which can then be packaged as a build artifact.
Before you begin
- Make sure you have Docker installed. We advise to use the most recent version.
Define a Docker capability in Bamboo. See Defining a new Docker capability
- If you're using Bamboo on Windows, you can't run Docker commands directly from the Windows command line. To use Docker tasks with Bamboo Windows, run Docker Machine.
To build a Docker image in Bamboo:
- In the job configuration screen, select Add task.
- Search for the Docker task type and select it.
- (optional) For future reference, add a Task description.
- (optional) Use the Disable this task checkbox to control whether your task gets run.
- (optional) Use the Add condition to task checkbox to make task run only when a certain condition is met.
You can find conditions on Atlassian Marketplace or implement your own. From the Repository drop-down list, select the Build a Docker image.
Complete the task settings.
Select Save.