How to override the entry point of a Bamboo Docker Runner job


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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.

*Except Fisheye and Crucible

    

Summary

This article discusses the process of overriding the default entrypoint of a Docker image within a Docker Runner job in Bamboo. At times, it may be necessary to modify the Dcoker entrypoint for specific operational requirements such as a Docker image that contains a hardcoded ENTRYPOINT or CMD instruction that may break Bamboo's ability to control the container during a Job execution.

Solution

When Bamboo launches a Docker Runner container, it runs the "tail -1 /dev/null" CMD to hold the container open, and then on a second session, it runs the commands set on the Job. When a container has a hardcoded ENTRYPOINT that exits quickly, the programmed CMD doesn't work, failing the job. To overcome that limitation, it is necessary to inject a temporary ENTRYPOINT that would allow Bamboo to run the required CMD and interface with the running container correctly.

An extra argument can be defined in Bamboo Docker configuration to override the default entrypoint. This can be achieved by passing a non-interactive command like below.

--entrypoint
/usr/bin/env 

Please check the below example.



Last modified on Sep 7, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.