Error: “error creating aufs mount to” when building dockerfile

前端 未结 11 1292
南旧
南旧 2020-12-13 05:55

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

 error creating aufs mount to /var/lib/docker/aufs/mnt   
 /6c1b42ce1a98b1c0f2d2a7f17c196221445f1054566065         


        
相关标签:
11条回答
  • 2020-12-13 06:31

    I'm using Raspbian with Raspberry 4

    Best way to do it..

    Check your docker version with: sudo docker info and check "Storage Driver"

    1. sudo systemctl stop docker
    2. sudo nano /etc/docker/daemon.json
    3. write this code below and save it
    {
        "storage-driver": "vfs"
    }
    
    1. sudo systemctl start docker

    altought vfs... has a performance issue and could not be the best choice... :)

    0 讨论(0)
  • 2020-12-13 06:33

    In windows after a restart, docker machine problem is solved for me.

    Use these commands:

    docker-machine stop
    docker-machine start
    docker-compose up
    
    0 讨论(0)
  • 2020-12-13 06:34

    If you try to use docker inside a persistent enable Live CD, you may encounter this error. I guess, it is due to the fact that you can't mount aufs inside overlayfs mounts, which is the persistent layer.

    The solution was simply using different driver. I've used vfs in /etc/docker/daemon.json

    Here it is

    {
        "storage-driver": "vfs"
    }
    
    0 讨论(0)
  • 2020-12-13 06:36

    I put this answer also here, as the google search lead me here since the @whitebrow's answer contains what term I searched for in google ERROR: Service '***' failed to build: error creating overlay mount to /var/lib/docker/overlay2/***/merged: no such file or directory

    In my case, the working workaround surprisingly was to restrict the number of 'RUN' docker building commands/layers, since if the number surpassed 60 layers/commands, it always ended up with that missing 'merged' folder error, no matter what was the contents of the command, even simple command such as RUN ls -la ended up with that error, if the total number of such/any commands was higher than about 60, strange. Merged subfolder was always missing, though even when I automatically generated all the merged subfolders, always was created on the fly a new layer with a new hash, which was missing that subfolder.

    0 讨论(0)
  • 2020-12-13 06:42

    AUFS is unable to mount the docker container filesystem.

    This is either because: the path is already mounted - or - there's a race condition in docker's interaction with AUFS, due to the large amount of existing volumes.

    To solve this, try the following:

    1. restart the docker service or daemon and try again.

    2. check mount for aufs mounted on any paths under /var/lib/docker/aufs/. If found, stop docker, then umount them (need sudo).

      example:

    mount

    none on /var/lib/docker/aufs/mnt/55639da9aa959e88765899ac9dc200ccdf363b2f09ea933370cf4f96051b22b9 type aufs (rw,relatime,si=5abf628bd5735419,dio,dirperm1)

    then sudo umount /var/lib/docker/aufs/mnt/55639da9aa959e88765899ac9dc200ccdf363b2f09ea933370cf4f96051b22b9

    1. If that doesn't work, stop docker, then sudo rm -rf /var/lib/docker/aufs. You will lose any existing stopped containers and all images. But this is just about guaranteed to solve the problem.
    0 讨论(0)
  • 2020-12-13 06:42

    I faced the same issue.I resolved it by adding the storage driver to /etc/docker/daemon.json

    you can refer this link as well to see other driver options. Visit https://docs.docker.com/storage/storagedriver/select-storage-driver/

    0 讨论(0)
提交回复
热议问题