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.

イメージは Docker のローカル イメージ インストール ディレクトリに保存され、ジョブ内においてその後の Docker タスクで使用できます。オプションとして、イメージを作業ディレクトリのファイルに保存した後、ビルド アーティファクトとしてパッケージ化できます。


  • 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.

Bamboo で Docker イメージをビルドするには

  1. In the job configuration screen, select Add task.
  2. Search for the Docker task type and select it.
  3. (optional) For future reference, add a Task description.
  4. (optional) Use the Disable this task checkbox to control whether your task gets run.
  5. (optionalUse 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. 
  6. From the Repository drop-down list, select the Build a Docker image.

  7.  Complete the task settings.

    Docker イメージのビルド...


    Build a docker image option in Docker task configuration

    結果として生成されるイメージに適用されるリポジトリ名 (およびオプションのタグ)。次のパターンに従います:


    Only repository is mandatory.


    既存の Dockerfile (タスクの作業ディレクトリにあります) を使用するか、Dockerfile のコンテンツを指定します。


    By default, Docker will reuse a cached build during the next build. See the Docker documentation.

    Select Do not use cache... to ensure that the new image will include changes since the last build. Note that this may incur a performance penalty.


    Specify the directory location and file name. Optionally configure a a job artifact to pass it to next stages and deployments.



    (Optional) Additional system environment variables that you want to pass to your build. Note that existing environment variables are automatically available to the executable. You can also include Bamboo global or build-specific variables (see Bamboo variables).
    Multiple variables should be separated with spaces. Parameters with spaces must be quoted (e.g JAVA_OPTS="-Xms200m -Xmx700m").


    (Optional) An alternative subdirectory, relative to the job's root directory, where Bamboo will run the executable. The root directory contains everything checked out from the job's configured source repository. If you leave this field blank, Bamboo will look for build files in the root directory. This option is useful if your task has a build script in a subdirectory and the executable needs to be run from within that subdirectory.
  8. 保存 を選択します。

最終更新日 2021 年 7 月 18 日


Powered by Confluence and Scroll Viewport.