1

I have unprivileged lxc container on Arch host created like this:

lxc-create -n test_arch11 -t download -- --dist archlinux --release current --arch amd64

And it doesn't run docker. What I did inside a container:

  1. Installed docker from Arch repos pacman -S docker
  2. Tried to run a hello-world container docker run hello-world
  3. Got the next error:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:297: applying cgroup configuration for process caused \"mkdir /sys/fs/cgroup/cpuset/docker: permission denied\"": unknown.

ERRO[0037] error waiting for container: context canceled

What is wrong and how to make docker work inside a container?

4
  • Are you running the command as root? If not, did you add your user to the docker group and logout/login? Non-root users cannot run docker containers "out of the box". Commented Oct 27, 2019 at 20:58
  • @AndyDalton, tried both, neither worked. Commented Oct 28, 2019 at 9:03
  • To clarify, you're running docker inside the LXC container? Commented Oct 28, 2019 at 14:48
  • @AndyDalton, yes Commented Oct 31, 2019 at 9:57

2 Answers 2

0

Because lxc and docker are using the same kind of isolation ( aka kernel namespace ) , you can not run docker in a unprivileged lxc .

You lxc container must have privilege .

But you can run docker in regular virtual machine ( kvm , virtualbox , ... )

1
  • But I could, it worked like several months ago and now after many updates it doesn't. Commented Oct 31, 2019 at 9:59
0

Fixed for me with adding a flag to the grub config. Here's the source: https://fedoraproject.org/wiki/Changes/CGroupsV2#Upgrade.2Fcompatibility_impact

Follow These Steps:

1- Edit /etc/default/grub

2- Add the following flag in GRUB_CMDLINE_LINUX line: systemd.unified_cgroup_hierarchy=0

3- Then : grub2-mkconfig

4- Restart your PC

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.