Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FROM {{ item.image }}
ENV container docker
{% if 'centos' in item.image %}
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/*;
RUN yum install -y epel-release python3 sudo
CMD ["/usr/sbin/init"]
{% elif 'debian' in item.image or 'ubuntu' in item.image %}
RUN apt-get update && \
apt-get install -y --no-install-recommends python3 sudo systemd
CMD ["/lib/systemd/systemd"]
{% endif %}
VOLUME ["/sys/fs/cgroup", "/tmp", "/run"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment