I installed docker image and built a image successfully.
When I ssh to the container and run the command service xxx start
, an error popped:
This is known issue with systemd
-based OSes inside Docker containers.
Short answer: as well as replacing fakesystemd
with systemd
you need to attach /sys/fs/cgroup
as a read-only volume into the container, build the image and then run it in "privileged" mode.
This is the best guide I've found for this. It uses Centos as the example, but should work with any systemd
-based OS.