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.
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.
G’day Bamboo customers, The wait is over! Bamboo Data Center edition you have been asking for is finally here! This self-managed enterprise offering of Bamboo has the resilience, reliability, and s...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events