Skip to content

Instantly share code, notes, and snippets.

@json-m json-m/Dockerfile
Created Feb 5, 2016

Embed
What would you like to do?
centos:7 working systemd
# 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" ]
@json-m

This comment has been minimized.

@json-m

This comment has been minimized.

Copy link
Owner Author

commented Nov 7, 2017

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
You can’t perform that action at this time.