Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Two Containers Unexpectedly Pushed


This has happened in two different projects -- one python and one nodejs

After building a container, we push to a container repo.

But sometimes, branch builds push both the branch container and another container that had been built earlier.

Here's an example of the double push:

> docker push [container_registry/repo]
1m 04s

+ docker push [container_registry/repo]
The push refers to repository [container_registry/repo]
c992ea337d7d: Preparing
c992ea337d7d: Pushed
[my_feature_branch]: digest: sha256:c82a1b8da6cdf4eb3d0cdee8bb547e96b35183bd169c093270adb96c249b9ff0 size: 3270
c526b4dd16ef: Preparing
c526b4dd16ef: Pushed
[a_different_feature_branch]: digest: sha256:f18c66379f167316609401d65ad411f7aa871c07ade7ce808682f0e542d3f886 size: 3270

The second push is then set as the most recent even though more recent versions of that feature branch have been built and pushed.


My hunch is that this has something to do with Docker caching (which is turned on in my pipeline), but I am not sure why it would be sending both containers. I do think that that the extra container might be the first from when the cache is refreshed.

[edit] I just removed the Docker Cache and re-ran two different branches. And the first one built (and presumably cached) is the one getting sent the second time.

Here is an abbreviated version of my pipeline.yml:

image: python:3.7
- step: &build_step
- docker
- if [ -n “$BITBUCKET_TAG” ]; then export TAG_NAME=$BITBUCKET_TAG; else export TAG_NAME=$BITBUCKET_BRANCH; fi

- export IMAGE_NAME=[container_registry/repo]:$TAG_NAME
- docker build -t $IMAGE_NAME .
- docker push [container_registry/repo]
- docker

- step:
- step: *build_step
- step: *build_step






0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

218 views 2 5
Read article

Community Events

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

Events near you