Home > OS >  Docker /var/lib/docker/overlay2/<id>/merged: no such file or directory
Docker /var/lib/docker/overlay2/<id>/merged: no such file or directory

Time:03-02

I am getting following error and couldn't find any solution.

#9 [builder 3/5] COPY . /app
#9 sha256:deb3e9c3d0d018c2253369e84f48bc653a4796eebadd10de1a2bb60b4954e239
#9 ERROR: error creating overlay mount to /var/lib/docker/overlay2/93eywfuy5gffv03b5zcpgetvq/merged: no such file or directory
------
 > [builder 3/5] COPY . /app:
------
error creating overlay mount to /var/lib/docker/overlay2/93eywfuy5gffv03b5zcpgetvq/merged: no such file or directory

Tried to clean up images, containers via following docker commands nothing help:

docker system prune -af
docker builder prune
docker rm $(docker ps -a -q)
docker rmi $(docker images -a -q)

# Tried to pull images without caches also failed
docker build --pull --no-cache -t "my-app" .

CodePudding user response:

To fix this;

  • Close Docker
  • Remove containers manually
rm -rf ~/Library/Containers/com.docker.docker
  • Start docker and it will magically work!

CodePudding user response:

the fix is to edit /etc/docker/daemon.json file and add below content to it:

{ "storage-driver": "devicemapper" }
 

Reload the systemctl daemon:

systemctl daemon-reload

And restart docker service:

systemctl restart docker
  • Related