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

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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 defaultentrypointof a Docker image within aDocker Runnerjob 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 entry point. This can be achieved by passing a non-interactive command like the one below.

1 2 --entrypoint /usr/bin/env

Please check the below example.

Command entered in the "Extra arguments for the docker run command" field.

Updated on March 11, 2025

Still need help?

The Atlassian Community is here for you.