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]
+ docker push [container_registry/repo]
The push refers to repository [container_registry/repo]
[my_feature_branch]: digest: sha256:c82a1b8da6cdf4eb3d0cdee8bb547e96b35183bd169c093270adb96c249b9ff0 size: 3270
[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.
 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:
- step: &build_step
- 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 login -u $QUAY_BUILD_USER -p $QUAY_BUILD_PASSWORD quay.io
- docker push [container_registry/repo]
- step: *build_step
- step: *build_step
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...
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