linuxdockercentoscentos7docker-ce

Docker-CE on centOS 7 can't run containers


I have Docker-CE 18.05.0-ce (also tried on 18.03.0).
After installation (used official docs for installation and post-installation) try to run:

docker run hello-world

It downloads but can't untar because of permissions: Output from command:

docker: failed to register layer: ApplyLayer exit status 1 stdout:  stderr: permission denied

Output in debug mode:

DEBU[2018-06-15T12:50:48] Downloaded 9bb5a5d4561a to tempfile /var/lib/docker/tmp/GetImageBlob852000141
DEBU[2018-06-15T12:50:48] Start untar layer
DEBU[2018-06-15T12:50:48] Cleaning up layer 5e34eb70d39d9ddbe0512db63ef2bf4811924cffbc5c6ce0a34e9c3b37af5363: ApplyLayer exit status 1 stdout:  stderr: permission denied

I've tried to use sudo and change permissions (e.g. 777) for folders in /var/lib/docker

Does anyone know how to fix it?

Some information from docker info:

Storage Driver: vfs
Cgroup Driver: cgroupfs
Runtimes: runc
Kernel Version: 4.13.13-5-pve
Operating System: CentOS Linux 7 (Core)

Solution

  • The reason was that I used CentOS as a virtual machine with LXC virtualization. There is solution how to run Docker in LXC, but didn't try it. I have changed VM to new one with KVM virtualization and now Docker works.