简体   繁体   中英

How to resolve “no cgroup mount found in mountinfo: unknown” error?

I am getting following error while starting docker container.

 Error response from daemon: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:326: applying cgroup configuration for process caused: no cgroup mount found in mountinfo: unknown
    Error: failed to start containers: postgres-11

My docker version is ----> Docker version 19.03.13-ce, build 4484c46
OS--> 
NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"

Thank you in advance.

I had the same error, " OCI runtime create failed: container_linux.go:367: starting container process caused: process_linux.go:340: applying cgroup configuration for process caused: no cgroup mount found in mountinfo: unknown "

First, check if " docker run hello-world " is working properly. This will validate the docker installation.

I found this script very useful. Owner: https://mobyproject.org/

  • Download with "curl https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh > check-config.sh"
  • Make rwx with "chmod 777 check-config.sh" & execute "./check-config.sh"
  • Understand the output, mainly the cgroup hierarchy.
  • If cgroup hierarchy is "properly mounted [/sys/fs/cgroup]" then we shouldn't be seeing this problem.
  • If cgroup hierarchy is something like " ????????? " then below are the things which you should seek to fix the problem.

Try & Hit solutions:

  1. Install cgroup-utils & cgroup-lite sudo apt-get install cgroup-lite cgroup-utils
  2. https://github.com/docker/for-linux/issues/219#issuecomment-375160449 Which is to mount systemd with sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
  3. There are few kernel setting solutions on the internet that you could try if you like.
  4. If nothings works, then it is surely the problem of your docker installation, which was my case too [SOLVED] , then you should go for replacing the docker installation. Default installation with docker-ce version 20.10 was also problematic for me but custom installation of docker-ce version 18.09 was helpful.

    Remove current installation :
    sudo apt-get purge docker-ce docker-ce-cli containerd.io || sudo rm -rf /var/lib/docker || sudo rm -rf /var/lib/containerd

    Install new docker-ce, docker-cli & containerd-io as per the Linux distribution :
    Go to https://download.docker.com/linux/ubuntu/dists/ , choose your Ubuntu version, then browse to pool/stable/, choose amd64, armhf, or arm64, and download the.deb file for the Docker Engine version you want to install & install with sudo dpkg -i /path/to/package.deb

In the end, recheck docker run hello-world .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM