systemd with cgroup v2
cannot use docker-compose with cgroupv2
[nix-shell:~/.../nixos-compose/docker-compose(docker-compose)]$ docker-compose -f /nix/store/0yg54vamr30vjq2qx06fax1d8c6kilqj-docker-compose up
WARNING: Found orphan containers (store_client_1, store_server_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Starting store_foo_1 ... done
Attaching to store_foo_1
foo_1 |
foo_1 | <<< NixOS Stage 2 >>>
foo_1 |
foo_1 | Cannot write to /run/resolvconf/lock
foo_1 | running activation script...
foo_1 | setting up /etc...
foo_1 | removing obsolete symlink ‘/etc/hosts.tmp’...
foo_1 | Warning: something's wrong at /nix/store/vn1xs9s2akf79y1pbya2qldydbf2b22m-setup-etc.pl line 120.
foo_1 | starting systemd...
foo_1 | systemd 247 running in system mode. (+PAM +AUDIT -SELINUX +IMA +APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT -GNUTLS +ACL +XZ +LZ4 -ZSTD +SECCOMP +BLKID -ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified)
foo_1 | Detected virtualization docker.
foo_1 | Detected architecture x86-64.
foo_1 |
foo_1 | Welcome to NixOS 21.11 (Porcupine)!
foo_1 |
foo_1 | Set hostname to <foo>.
foo_1 | Failed to create /system.slice/docker.service/init.scope control group: Operation not permitted
foo_1 | Failed to allocate manager object: Operation not permitted
foo_1 | [!!!!!!] Failed to allocate manager object.
foo_1 | Exiting PID 1...
store_foo_1 exited with code 255
It seems to be an issue with the version of nixpkgs. I pinned the commit to the release of 21.05 and it worked fine