Running a Docker container in Bamboo
By default, the task's working directory is mounted and used as the Docker container's working directory, but you can specify your own settings.
By default, the container is removed on completion of the task, but you can choose Detach container to have the container continue to run after a deployment project completes. Containers can be linked to detached containers started by preceding tasks in a job by selecting the 'Link to detached containers' option.
Note that a non-detached container that fails to start will not be removed when the Bamboo task completes. See this KB article for more details.
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 run a Docker container in Bamboo:
- In you job configuration screen, click Add task.
- Search for the Docker tasks 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.
Choose the Run a Docker container command and complete the settings. Click below to see more information about the settings: