Open nalipaz opened 8 years ago
The default setup for this container doesn't use systemd, so the file would never be used. You would need to fork and edit the Dockerfile so that systemd is used to initialize the container rather than the entrypoint script. You would need to do something along the lines of the following rough pseudo-code
RUN yum -y update; yum clean all; \
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;
INSERT-YOUR-ENV-AND-HTTPD-INSTALL-SETUP-HERE
VOLUME [ "/sys/fs/cgroup" ]
CMD ["/usr/sbin/init"]
Note that by using systemd, you'll have to mount the host's cgroups volume into the container, and possibly add capabilities or run the container with --privileged.
I asked this on stackoverflow, but since this is the image I am using and it doesn't yet seem to be documented I thought I might ask here. http://stackoverflow.com/questions/37366257/how-to-add-environmentfile-directive-to-systemctl-using-docker-with-centos7-http
Basically I am doing:
Yet my environment variables are not available. Any ideas? Is this a feature opportunity? Will I need to fork this to get it working perhaps? Thanks