Created
February 5, 2016 03:14
-
-
Save json-m/79d06f1d17b60ff8f3d7 to your computer and use it in GitHub Desktop.
centos:7 working systemd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# modified from some redhat page | |
# to run: --privileged -ti -v /sys/fs/cgroup:/sys/fs/cgroup:ro | |
FROM centos:7 | |
MAINTAINER "jason" <me@jason.lv> | |
ENV container docker | |
RUN yum -y update; \ | |
yum clean all; \ | |
yum -y install systemd; \ | |
yum clean all; \ | |
yum install openssh-server -y; \ | |
yum clean all; \ | |
systemctl enable sshd.server; \ | |
(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/*; | |
EXPOSE 22 | |
VOLUME [ "/sys/fs/cgroup" ] | |
CMD [ "/usr/sbin/init" ] |
also this is an abomination do not use this if it still even works
leaving this here to publicly shame myself for putting systemd+sshd in a container
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://developerblog.redhat.com/2014/05/05/running-systemd-within-docker-container/