-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.acceptance
49 lines (41 loc) · 1.83 KB
/
Dockerfile.acceptance
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
38
39
40
41
42
43
44
45
46
47
48
49
FROM debian:stretch
ENV container docker
ENV LC_ALL C
ENV DEBIAN_FRONTEND noninteractive
ENV PUPPET_AGENT_VERSION 6.15.0-1stretch
RUN apt-get update && \
apt-get install -y wget && \
wget https://apt.puppetlabs.com/puppet6-release-stretch.deb && \
dpkg -i puppet6-release-stretch.deb && \
rm puppet6-release-stretch.deb && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN apt-get update && \
apt-get purge -y locales && \
apt-get install -y puppet-agent=${PUPPET_AGENT_VERSION} openssh-server systemd python cron && \
apt-get install -y --reinstall locales libc6 && \
rm -f /lib/systemd/system/multi-user.target.wants/* \
/etc/systemd/system/*.wants/* \
/lib/systemd/system/local-fs.target.wants/* \
/lib/systemd/system/sockets.target.wants/*udev* \
/lib/systemd/system/sockets.target.wants/*initctl* \
/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* \
/lib/systemd/system/systemd-update-utmp* && \
systemctl enable ssh.service && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
RUN mkdir -p /etc/systemd/system/ssh.service.d/ && \
echo '[Service] \n\
ExecStartPre= \n\
ExecStartPre=/usr/sbin/sshd -t -o UsePrivilegeSeparation=no \n\
ExecStart= \n\
ExecStart=/usr/sbin/sshd -D -o UseDNS=no -o UsePAM=no -o PasswordAuthentication=yes -o UsePrivilegeSeparation=no -o PidFile=/tmp/sshd.pid \n\
ExecStartPost= \n\
ExecStartPost=-/usr/bin/apt-get update' > /etc/systemd/system/ssh.service.d/override.conf
VOLUME [ "/sys/fs/cgroup" ]
RUN ln -s /opt/puppetlabs/puppet/bin/* /usr/local/sbin/
CMD ["/lib/systemd/systemd"]