I try to install snap in a Docker container. The OS is CentOS 8. For a project I have to use the Mumble client. The idea is to install snap and mumble in a Docker container .
I use the post as a template for my Docker file. Snapd in Docker
I get this error message:
Step 7/9 : RUN systemctl enable --now snapd.socket
---> Running in 4271707f5477
Created symlink /etc/systemd/system/sockets.target.wants/snapd.socket → /usr/lib/systemd/system/snapd.socket.
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
The command '/bin/sh -c systemctl enable --now snapd.socket' returned a non-zero code: 1
Otherwise systemd complains about /sys not being writable when reloading udev rules (ConditionPathIsReadWrite=/sys was not met)
Otherwise strictly confined snaps fail to execute: $ docker exec -it snapd emoj cannot perform operation: mount --rbind /lib/modules /tmp/snap.rootfs_NCx2ET//lib/modules: No such file or directory
I’m immediately running into issues with your Dockerfile before getting to Step 7, but it might help. I’m still having issues myself, but I’m getting some systemctl functionality.