Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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 Edited

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
definitions:
steps:
- step: &build_step
caches:
- docker
script:
- 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
....[build]
- docker build -t $IMAGE_NAME .
- docker login -u $QUAY_BUILD_USER -p $QUAY_BUILD_PASSWORD quay.io
- docker push [container_registry/repo]
services:
- docker


pipelines:
default:
- step:
...
branches:
‘**‘:
- step: *build_step
tags:
‘*’:
- step: *build_step

 

 

 

 

 

0 answers

Suggest an answer

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

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,230 views 0 3
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