CentOS / sig-cloud-instance-images

CentOS cloud images
781 stars 563 forks source link

Systemd instructions fail on MacOS #76

Open jmckitt opened 7 years ago

jmckitt commented 7 years ago

https://github.com/docker-library/docs/tree/master/centos

After exactly following the steps outlined under Systemd Integration, I get:

**

[!!!!!!] Failed to mount API filesystems, freezing. **

This is reproduceable. I have Docker 1.13.1 running on Mac (El Capitan)

c7-systemd-httpd-Dockerfile.txt c7-systemd-Dockerfile.txt

Also, there is a minor doc error:

Build this image:

$ docker build --rm -t local/c7-systemd-httpd

There should be a "." at the end of the second command.

$ docker build --rm -t local/c7-systemd-httpd .

jmckitt commented 7 years ago

There are some other somewhat related threads on this, mostly covering other versions and slightly different angles. A few of them claimed it was fixed in versions of Docker older than what I am using. One workaround which works is starting the image with:

docker run -ti --cap-add SYS_ADMIN --security-opt seccomp:unconfined -p 80:80 local/c7-systemd-httpd

This is fine for non-production use, which will work for my scenario but looks to have some major security implications.

dholth commented 5 years ago

Have you tried mounting cgroup with these arguments to docker run? ['--tmpfs', '/tmp:exec', '--tmpfs', '/run', '-v', '/sys/fs/cgroup:/sys/fs/cgroup:ro']