docker push to private repository pushes already pushed layers

Issue #15850 resolved
Martin Norbäck Olivers created an issue

I have a docker pipelines script that ends with

- docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD <our-private-repo>
- docker push $IMAGE

However, it looks like docker pushes images that are already present in the repository. I get the following output. This takes quite a bit of time as these layers are large.

b92ae2c28af1: Preparing
7bb9bf8c293d: Preparing
2939806abd05: Preparing
eb84ae861586: Preparing
227d94b074c0: Preparing
066828d986f0: Preparing
daa6e91e491c: Preparing
6b60013e5875: Preparing
d6335a641f5e: Preparing
5c33df241050: Preparing
ffc4c11463ee: Preparing
daa6e91e491c: Waiting
6b60013e5875: Waiting
d6335a641f5e: Waiting
066828d986f0: Waiting
ffc4c11463ee: Waiting
7bb9bf8c293d: Pushed
b92ae2c28af1: Pushed
eb84ae861586: Pushed
daa6e91e491c: Pushed
066828d986f0: Pushed
227d94b074c0: Pushed
5c33df241050: Pushed
d6335a641f5e: Pushed
ffc4c11463ee: Pushed
2939806abd05: Pushed
6b60013e5875: Pushed

When I do the exact same command on my own machine (Docker version 17.12.0-ce, build c97c6d6) I get the following (i.e. only the newly built last layer is actually being pushed. The id:s of the previous layers are the same for each build, but somehow the pipelines docker push does not recognize that the layers have already been pushed (by a previous build).

3133fd13fb37: Pushed
7bb9bf8c293d: Layer already exists
2939806abd05: Layer already exists
eb84ae861586: Layer already exists
227d94b074c0: Layer already exists
066828d986f0: Layer already exists
daa6e91e491c: Layer already exists
6b60013e5875: Layer already exists
d6335a641f5e: Layer already exists
5c33df241050: Layer already exists
ffc4c11463ee: Layer already exists

Our repository is using the registry:2 image of the docker registry.

Comments (4)

  1. Kenny MacLeod staff

    OK, that's an odd one, we haven't seen that before. Please raise a support ticket and include the full logs from the build, both your local one and the pipelines generated one, along with your bitbucket-pipelines.yml file. It'd also be helpful if you could run your local build in a non-interactive shell, so that docker will print out the layer upload progress in batch mode.

  2. Martin Norbäck Olivers reporter

    It has started working since 3 days ago. I haven't really changed anything.

  3. Wick S

    Hi i am facing the same issue with AWS ECR repository. the layers exists remotely already but it pushes again everytime

  4. Log in to comment