Bad docker image pulled

Nicolas LARZILLIERE November 8, 2023

Hi, I have a problem I've never had before.

I use a custom Docker Image which is private.
I have the IDs in Workspace Vars.
I never get any problem with others previous version of this image.

When I use pipelines, Bitbucket pulls the wrong image, the version pulled is a :latest version from 1 week ago.

Have you encountered this problem before?

PS: In "build setup" when I click on "Images used: build: docker.io/myCustomImage" the SHA was not the new one and the url sends to a 404

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 9, 2023

Hello @Nicolas LARZILLIERE and welcome to the Community!

Could you confirm that if you pull the same image tag locally, does it download a more recent version? 

Also, by any chance are you using self-hosted runners in your pipeline? I ask this because you might have an older version of the image already downloaded in the runner's host, which would make the runner use that cached local version instead of downloading it from Dockerhub.

Thank you, @Nicolas LARZILLIERE !

Patrik S

Nicolas LARZILLIERE November 14, 2023

Hello @Patrik S
Thank you for your answer first of all!

I don't think I use self-hosted runners.
My image is on DockerHub, in private, and I call it using my credentials as Workspace Variables, it is build with "--no-cache" as argument of "docker build".

Locally, I pull the latest version of the image every time.

It's as if Bitbucket had some cache when pulling the image, is this possible ?

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 15, 2023

Hello @Nicolas LARZILLIERE ,

Could you confirm if the latest tag in your Docker image points to the version from 1 week ago? 

If you don't specify an image tag in your pipeline YML,  Bitbucket will try to fetch the image with the latest tag.

Another option would be for you to try pushing the updated image with a different tag, e.g my_image:updated, and then configure your pipeline to use this version and check if the updated image is being pulled.

image: my_image:updated

pipelines:
  default:
      - step:
          name: Test Step
          script:
           - echo "Test"

Thank you, @Nicolas LARZILLIERE !

Patrik S

Nicolas LARZILLIERE November 15, 2023

Hello,

well at the end I have created a new Image and it worked, because I tried many things with the buggy image without effects.

For answer you, with the buggy image, when I forced another tag, all was going good, pulling the last good forced tag.
The problem appear only when I tried to pull the ":latest" tag.

Thank you for your answers and the effort you put into helping me !

Like Patrik S likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events