You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
If a container starts up with CMD or ENTRYPOINT, will that CMD or ENTRYPOINT run in the background or another shell while the pipeline script is running?
More specifically:
I have a Dockerfile that ends like this:
CMD /cmd.sh
I want to use the container built from this Dockerfile as an environment to run my pipeline script in.
Will my CMD run in the background or another shell as my pipeline is running?
I don't want it to -- I just want to run the pipeline script.
But I need to know if I need to update the CMD script so that it won't run when the pipeline starts.
What I've Tried
I've looked for details in the official documentation on the subject and listed processes as a step in the pipeline.
Thanks.
Hello @joe ,
Welcome to Atlassian Community!
When a build is triggered in pipelines, it will start the build container to run your script commands. The docker run command that is executed under the hood in pipelines to start the container utilizes the --entrypoint flag to override any CMD or ENTRYPOINT you have defined in the image itself.
This means that pipelines will ignore any entry point/cmd you have defined in the image itself, and will always overwrite it with /bin/bash which is the shell session where the commands you have included in the script part of your YML file will be executed.
Hope that helps to clarify your questions :)
Thank you, @joe !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.