forked from maci0/docker-systemd-unpriv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (28 loc) · 1.34 KB
/
Dockerfile
File metadata and controls
37 lines (28 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM centos:centos7
MAINTAINER Marcel Wysocki "maci.stgn@gmail.com"
ENV container docker
RUN yum -y update; yum clean all
RUN yum -y swap -- remove systemd-container systemd-container-libs -- install systemd systemd-libs dbus
RUN systemctl mask dev-mqueue.mount dev-hugepages.mount \
systemd-remount-fs.service sys-kernel-config.mount \
sys-kernel-debug.mount sys-fs-fuse-connections.mount \
display-manager.service graphical.target systemd-logind.service
ADD dbus.service /etc/systemd/system/dbus.service
RUN systemctl enable dbus.service
# Setup kitchen user with passwordless sudo
RUN useradd -d /home/kitchen -m -s /bin/bash kitchen && \
(echo kitchen:kitchen | chpasswd) && \
mkdir -p /etc/sudoers.d && \
echo 'kitchen ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/kitchen && \
# Setup SSH daemon so test-kitchen can access the container
yum -y install openssh-server openssh-clients && \
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N '' && \
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N '' && \
echo 'OPTIONS="-o UseDNS=no -o UsePAM=no -o PasswordAuthentication=yes"' >> /etc/sysconfig/sshd && \
systemctl enable sshd.service && \
# Setup crond
yum -y install cronie && \
systemctl enable crond.service
VOLUME ["/sys/fs/cgroup"]
VOLUME ["/run"]
CMD ["/usr/lib/systemd/systemd"]