Failed to register layer docker pull

Privacy & Transparency

We and our partners use cookies to Store and/or access information on a device. We and our partners use data for Personalised ads and content, ad and content measurement, audience insights and product development. An example of data being processed may be a unique identifier stored in a cookie. Some of our partners may process your data as a part of their legitimate business interest without asking for consent. To view the purposes they believe they have legitimate interest for, or to object to this data processing use the vendor list link below. The consent submitted will only be used for data processing originating from this website. If you would like to change your settings or withdraw consent at any time, the link to do so is in our privacy policy accessible from our home page.

Show

Question:

I am trying to pull the latest official Java docker image (java:8), but I keep getting a failed to register layer error. The Java 7 and 9 docker images download successfully. I am running OS X El Capitan version 10.11.1.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

>docker-v

Docker version1.10.0,build590d5108

>docker-machine-v

docker-machine version 0.6.0,build e27fb87

>docker pull java:8

8:Pulling from library/java

03e1855d4f31:Extracting [==================================================>]51.36MB/51.36MB

a3ed95caeb02: Download complete

9269ba3950bb:Download complete

6ecee6444751:Download complete

5b865d39f77d:Download complete

e7e5c0273866:Download complete

6a4effbc4451:Download complete

4b6cb08bb4bc:Download complete

7b07ad270e2c:Download complete

failed toregister layer: rename/mnt/sda1/var/lib/docker/image/aufs/layerdb/tmp/layer-273420626 /mnt/sda1/var/lib/docker/image/aufs/layerdb/sha256/78dbfa5b7cbc2bd94ccbdba52e71be39b359ed7eac43972891b136334f5ce181:directory notempty

Has anyone run across a similar error and successfully resolved it? Thanks

Answer:

Sometimes docker messes up its workspace, probably that’s the cause.
You can try these:

  • stop all (java) containers, remove them, delete the java image (or all images),
    then re-pull and run.
  • if this doesn’t help, then restart the docker engine too.
  • if even this doesn’t solve the problem, stop the docker engine, delete the docker working directory, then restart docker engine.

In my experience, this solves all similar issues like OP.