forked from sobolevn/git-secret
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes sobolevn#291 ... remove extra changes newline
- Loading branch information
1 parent
14eea46
commit 8789269
Showing
2 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
FROM debian:stable | ||
|
||
ENV DEBIAN_FRONTEND="noninteractive" container="docker" | ||
|
||
RUN apt-get update \ | ||
&& apt-get upgrade -y \ | ||
&& apt-get install -y \ | ||
apt-utils \ | ||
curl \ | ||
locales \ | ||
lsb-release \ | ||
net-tools \ | ||
openssh-server \ | ||
python-pip \ | ||
python2.7 \ | ||
sudo \ | ||
systemd \ | ||
&& pip install --upgrade pip \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ | ||
&& if ! getent passwd kitchen; then \ | ||
useradd -d /home/kitchen -m -s /bin/bash -p '*' kitchen; \ | ||
fi \ | ||
&& echo "kitchen ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \ | ||
&& echo "Defaults !requiretty" >> /etc/sudoers \ | ||
&& mkdir -p /home/kitchen/.ssh \ | ||
&& chown -R kitchen /home/kitchen/.ssh \ | ||
&& chmod 0700 /home/kitchen/.ssh \ | ||
&& echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCydNsPAZszt2CKjBFUhLEnkU5XbD8YbfvACgRfHszMtp7224pDrKq/X76laLEmuVwVXnuxhRDhMy59SzGPIxR0/vR8ZuvySISpkKK+xlN3SB4keF//rac8o/QZivPG33kpHUFug3s81NZrU1410HvlrwJh+qQHcJC9+TCs633QtzoD/IxL21xjyAOkRbPL1HW97RZomRatrwyuP9PCZdtfLn55FRMxSn4Lu/h5X9xcPEbqHcr2FDPJhNnPCj97JUd3YENg8wErCoE0kn+e/NQMhOYEeHJ66QsP/G/YnrO2uOzm54N3840TO9EP3uDHWllpcEsvDlbc4yGYqjBzaV3r kitchen_docker_key' >> /home/kitchen/.ssh/authorized_keys \ | ||
&& chown kitchen /home/kitchen/.ssh/authorized_keys \ | ||
&& chmod 0600 /home/kitchen/.ssh/authorized_keys \ | ||
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen \ | ||
&& cd /lib/systemd/system/sysinit.target.wants/; ls | grep -v systemd-tmpfiles-setup | /usr/bin/xargs rm -f $1 \ | ||
&& /bin/rm -f /lib/systemd/system/multi-user.target.wants/* \ | ||
&& /bin/rm -f /etc/systemd/system/*.wants/* \ | ||
&& /bin/rm -f /lib/systemd/system/local-fs.target.wants/* \ | ||
&& /bin/rm -f /lib/systemd/system/sockets.target.wants/*udev* \ | ||
&& /bin/rm -f /lib/systemd/system/sockets.target.wants/*initctl* \ | ||
&& /bin/rm -f /lib/systemd/system/basic.target.wants/* \ | ||
&& /bin/rm -f /lib/systemd/system/anaconda.target.wants/* \ | ||
&& /bin/rm -f /lib/systemd/system/plymouth* \ | ||
&& /bin/rm -f /lib/systemd/system/systemd-update-utmp* \ | ||
&& sed -ri 's/^#?UsePAM\s+.*/UsePAM no/' /etc/ssh/sshd_config \ | ||
&& sed -ri 's/^#?PubkeyAuthentication\s+.*/PubkeyAuthentication yes/' /etc/ssh/sshd_config \ | ||
&& sed -ri 's/^#?UsePrivilegeSeparation\s+.*/UsePrivilegeSeparation no/' /etc/ssh/sshd_config \ | ||
&& echo "UseDNS=no" >> /etc/ssh/sshd_config \ | ||
&& systemctl set-default multi-user.target \ | ||
&& ln -s /lib/systemd/system/ssh.service /etc/systemd/system/multi-user.target.wants/ssh.service \ | ||
&& ln -s /lib/systemd/system/systemd-journald.service /etc/systemd/system/multi-user.target.wants/systemd-journald.service \ | ||
&& echo $'[Unit]\ | ||
\nDescription=Finish boot up\ | ||
\nAfter=ssh.service\ | ||
\n\ | ||
\n[Service]\ | ||
\nType=oneshot\ | ||
\nRemainAfterExit=yes\ | ||
\nExecStartPre=/bin/sleep 3s\ | ||
\nExecStart=/bin/rm -f /run/nologin\ | ||
\n\ | ||
\n[Install]\ | ||
\nWantedBy=default.target' >> /etc/systemd/system/FinishBootUp.service \ | ||
&& ln -s /etc/systemd/system/FinishBootUp.service /etc/systemd/system/multi-user.target.wants/FinishBootUp.service | ||
|
||
EXPOSE 22 | ||
|
||
VOLUME [ "/sys/fs/cgroup" ] |
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