Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: "error creating aufs mount to" when building dockerfile

I get this error when I try to build a docker file

 error creating aufs mount to /var/lib/docker/aufs/mnt     /6c1b42ce1a98b1c0f2d2a7f17c196221445f1054566065d4c607e4f1b99930eb-init:     invalid argument 

What does it mean? How do I fix it?

like image 761
lars Avatar asked Jun 22 '15 15:06

lars


2 Answers

I had some unresolved errors after removing /var/lib/docker/aufs, which a couple extra steps cleared up.

To add to @benwalther answer, since I lack the reputation to comment:

# Cleaning up through docker avoids these errors #   ERROR: Service 'master' failed to build: #     open /var/lib/docker/aufs/layers/<container_id>: no such file or directory #   ERROR: Service 'master' failed to build: failed to register layer: #     open /var/lib/docker/aufs/layers/<container_id>: no such file or directory docker rm -f $(docker ps -a -q) docker rmi -f $(docker images -a -q)  # As per @BenWalther's answer above sudo service docker stop sudo rm -rf /var/lib/docker/aufs  # Removing the linkgraph.db fixed this error: #   Conflict. The name "/jenkins_data_1" is already in use by container <container_id>. #   You have to remove (or rename) that container to be able to reuse that name. sudo rm -f /var/lib/docker/linkgraph.db   sudo service docker start 
like image 182
AManOfScience Avatar answered Sep 19 '22 16:09

AManOfScience


I have removed /var/lib/docker/aufs/diff and got the same problem:

error creating aufs mount to /var/lib/docker/aufs/mnt/blah-blah-init: invalid argument

It solved by running the following commands:

docker stop $(docker ps -a -q); docker rm $(docker ps -a -q); docker rmi -f $(docker images -a -q) 
like image 31
Art Avatar answered Sep 22 '22 16:09

Art