How to use Bamboo variables when using an existing Dockerfile in a Docker build task

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

    

目的

When using a Docker task in Bamboo to build a docker image, it may be desirable to pass and dereference Bamboo variables even when using an existing Dockerfile.

ソリューション

Use Docker build arguments:

It can be configured in Bamboo inside your Docker task configuration using the Additional Arguments field. Example below:

Additional Arguments
--build-arg VERSION=${bamboo.versionVariable}
Dockerfile
ARG VERSION
RUN curl -L --silent https://packages.atlassian.com/maven-external/com/atlassian/bamboo/atlassian-bamboo/${VERSION}/atlassian-bamboo-${VERSION}.pom > /tmp/pom.xml



最終更新日: 2021 年 1 月 6 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.