If we look at containers precisely they run a lot of services that must be disabled by default. It kills a container way. xinetd, crond, rsyslogd must be stopped and removed from container. They were started by multi-user.target
I see the most easiest way is to change Dockerfile as
RUN (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/*;
VOLUME [ “/sys/fs/cgroup” ]
CMD [“/usr/sbin/init”]
If we look at containers precisely they run a lot of services that must be disabled by default. It kills a container way. xinetd, crond, rsyslogd must be stopped and removed from container. They were started by multi-user.target
I see the most easiest way is to change Dockerfile as
RUN (cd /lib/systemd/ system/ sysinit. target. wants/; for i in *; do [ $i == systemd- tmpfiles- setup.service ] || rm -f $i; done); \ system/ multi-user. target. wants/* ;\ system/ *.wants/ *;\ system/ local-fs. target. wants/* ; \ system/ sockets. target. wants/* udev*; \ system/ sockets. target. wants/* initctl* ; \ system/ basic.target. wants/* ;\ system/ anaconda. target. wants/* ;
rm -f /lib/systemd/
rm -f /etc/systemd/
rm -f /lib/systemd/
rm -f /lib/systemd/
rm -f /lib/systemd/
rm -f /lib/systemd/
rm -f /lib/systemd/
VOLUME [ “/sys/fs/cgroup” ]
CMD [“/usr/sbin/init”]