Can't run Docker container due device mapper error

前端 未结 5 553
囚心锁ツ
囚心锁ツ 2020-12-25 14:36

I just can\'t create and run new containers in Docker anymore. But in the same time a can run previously created containers.

When I try to do something like this:<

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-25 15:29

    I've been fighting this issue with Debian 8.2. I had other problems because I run a 4.3.3 Kernel (default is 3.16) with grsec.

    Despite the GRSEC issues (mount & chmod denied) I was able to run docker and create some image and container.

    Then, I would reboot and docker would just spit out the error. I ran thin_check and what I found was this:

    • metadata was fine (I don't use a thin pool right now since docker keeps on telling me that my thin pool isn't a thin pool...)
    • data was corrupted.

    Tried to repair it but thin_restore crashes.

    I realized that: docker daemon ... was working but can't be stopped with systemctl stop docker.service. It says that the service is stopped but the daemon is still in memory (ps -elf | grep docker)

    To fix the problem I had to change the DOCKER_STORAGE_OPTIONS in /etc/default/docker

    rm -rf /var/lib/docker
    reboot
    

    At boot time, the service starts. docker info

    Shows the info as expected. Built an image. Rebooted, the service starts fine again. I think that basically the docker daemon can't be stopped and killing it with a:

    kill 
    

    Causes the data file to be corrupted and therefore the checksum won't match.

    Bottom line is don't mix and match docker.service and docker daemon. At least on Debian/Ubuntu.

提交回复
热议问题