Docker push is getting stuck at pushing one layer

I encountered a problem when trying to push an image to a local registry. Everything builds OK, I can start the container, but I am unable to push it successfully to the registry. The push will run for several hours, consuming as much memory as it can (~16-17 GB is where it usually ends up), and then it quits. The process com.docker.service won’t release the memory after this, so a restart is required.

The push itself starts as usual, but one layer is extremely slow and often drops down a hundred megs or so after a while. The output looks something like this:

e63182f8f000: Layer already exists
7451b27a9acf: Pushing [===========================================>]  74.24kB/74.24kB
c11ddffd11fc: Pushing [===========================================>]  86.53kB/86.53kB
8225699703ad: Pushing [===========================================>]  205.4MB/205.4MB
a004118b76dc: Pushing [===========>                                ]  154.1MB/563.3MB
92961e2db95b: Layer already exists
67044ff0aa8f: Layer already exists

I have managed to isolate the problem to this step in the Dockerfile:

FROM ubuntu:18.04
...
RUN apt-get update && \
    apt-get install -y azure-cli

Basically, the only thing the container contains is support for Azure-CLI and Kubernetes.

The same problem occurs on two different computers, both running Win10 1809. I have tried both Docker stable and 2.0.2.1 edge.

Any tips on how to solve the problem or how to further investigate what might be the cause?

1 Like

I get something similar trying to push an image with a 700MB layer.
It gets to 450MB and then bails with:
error creating overlay mount to /var/lib/docker/overlay2/f80d03a6c9335315dddb2c5e804f888317beb3a3913006478d55324b5343a5f9/merged: device or resource busy

I solved my problem setting

“max-concurrent-uploads”: 1

in /etc/docker/daemon.json, and restarting, pushing

1 Like

Have same problem.
Two different machines and same error.
I am pushing on hub.docker.com and also in registry.gitlab.com it freeze itself in one layer.
Can not find a solution. Tried to set max concurrent uploads to 1 and same thing.
Tried installing new and older versions and same thing.
Sometimes is going without any problem and sometimes it is just freezing.

1 Like

I used the following command and it solved the stuck pushing for me.

sudo systemctl restart docker
1 Like

This worked. Thanks!