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.
Hi, I have a task that's using a Docker container to perform a deployment.
Under the "Docker" tab of the job I've selected "Docker container"
I've provided an image, and for this example let's say the tag is "stable". The tag doesn't change for this job.
In the Task I have a Script step. The "Interpreter" is "Shell". The "Script location" is "File". The "Script file" is "/deploy.sh". And I'm passing some values in "Argument".
The problem I'm facing is when I build a new image and push to our registry, this job doesn't pull the latest image.
I can make it pull if I create a new tag and set that in the "Docker" tab, but ideally the tag would remain the same. We want clients to use our "stable" tag for their builds and we continually build and push to that image.
Is there a way to ensure the Docker image is pulled before every run? Do I need to add another "Docker pull" task? I think that would work, but was hoping not to have to add another task.
Thanks
We have the same issue.
This is what works for me: I created another plan with a shell script that pulls the docker image I need. I schedule this plan to run daily. The latest docker is then updated in the cache.
Will that pull the image on all of the bamboo agents, or just the one where the shell script was executed?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not sure what you mean. You can try and check to see what happens.
See this reference for pulling docker images:
https://docs.docker.com/engine/reference/commandline/image_pull/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Our Bamboo instance has multiple agents (separate machines that do the work for a plan). I'm pretty sure we've ruled out that option (separate job/plan to pull the image) because the shell script will be run on one of the agents. On that agent the Docker image would be pulled correctly. But not on all agents. So when our job that uses the Docker image runs, there's no guarantee it will run on the agent with the updated image.
Our administrators could set up a cron job and have that image pulled on every agent, but we'd prefer a checkbox on the job to indicate the agent should pull the image every time the job runs.
We've also pondered having a separate stage to pull the image, but stages within a plan aren't guaranteed to run on the same agent.
For now we've decided to tag each image release. We created a global Bamboo variable with the tag name and update it when we have a release. Each of the jobs that use this image use that variable to set the tag. That's been working and ensures the image is pulled every time the tag changes. It just requires one small manual step per release.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's a shame that Bamboo doesn't support this simple feature.
Maybe in the future
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.