Bitbucket Pipelines does not execute the build image's ENTRYPOINT/CMD script

お困りですか?

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

コミュニティに質問


 

プラットフォームについて: Cloud のみ - この記事は、 クラウド プラットフォームのアトラシアン製品にのみ適用されます。

   

要約

When running a build in Bitbucket Pipelines, the build image's ENTRYPOINT or CMD script is not being executed.

環境

Bitbucket Pipelines on Bitbucket Cloud.

原因

Once a build is triggered in Bitbucket Pipelines, a build container will be spun up to run the commands defined in the step's script section. The docker run command that is executed in the background in pipelines to start the build container utilizes the --entrypoint flag to override any CMD or ENTRYPOINT previously defined in the build image.

Pipelines needs to overwrite the image's entry point in order to guarantee that it can execute the step commands from your bitbucket-pipelines.yml.

ソリューション

You can move the script to a file stored in the image, and invoke the script from your step's script on bitbucket-pipelines.yml.

For example, if your image (e.g my/customimage) contains a script in the path /opt/bin/my_script.sh, the script can be invoked directly in bitbucket-pipelines.yml as follows: 

- step:
     image: my/customimage
     script: 
       - /opt/bin/my_script.sh

If you are encountering issues following this documentation - please raise a support ticket or a community support ticket for further assistance.

説明 Bitbucket Pipelines does not execute the build image's ENTRYPOINT/CMD script
製品Bitbucket Cloud
最終更新日: 2024 年 1 月 19 日

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

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