Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Carlos Hernandez
committed
Sep 24, 2017
1 parent
fb29858
commit c9861a1
Showing
23 changed files
with
971 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 <%= @username %>; then \ | ||
useradd -d /home/<%= @username %> -m -s /bin/bash -p '*' <%= @username %>; \ | ||
fi \ | ||
&& echo "<%= @username %> ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \ | ||
&& echo "Defaults !requiretty" >> /etc/sudoers \ | ||
&& mkdir -p /home/<%= @username %>/.ssh \ | ||
&& chown -R <%= @username %> /home/<%= @username %>/.ssh \ | ||
&& chmod 0700 /home/<%= @username %>/.ssh \ | ||
&& echo '<%= IO.read(@public_key).strip %>' >> /home/<%= @username %>/.ssh/authorized_keys \ | ||
&& chown <%= @username %> /home/<%= @username %>/.ssh/authorized_keys \ | ||
&& chmod 0600 /home/<%= @username %>/.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/sshd.service /etc/systemd/system/multi-user.target.wants/sshd.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
FROM fedora:latest | ||
|
||
ENV container="docker" | ||
|
||
RUN dnf clean all \ | ||
&& dnf makecache \ | ||
&& dnf install -y \ | ||
curl \ | ||
findutils \ | ||
gcc \ | ||
glibc-langpack-en.x86_64 \ | ||
libffi-devel \ | ||
net-tools \ | ||
openssh-server \ | ||
openssl-devel \ | ||
python2-devel \ | ||
python2-pip \ | ||
redhat-lsb \ | ||
redhat-rpm-config \ | ||
sudo \ | ||
systemd \ | ||
&& pip install --upgrade pip \ | ||
&& dnf clean all \ | ||
&& if ! getent passwd <%= @username %>; then \ | ||
useradd -d /home/<%= @username %> -m -s /usr/bin/bash -p '*' <%= @username %>; \ | ||
fi \ | ||
&& echo "<%= @username %> ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \ | ||
&& echo "Defaults !requiretty" >> /etc/sudoers \ | ||
&& mkdir -p /home/<%= @username %>/.ssh \ | ||
&& chown -R <%= @username %> /home/<%= @username %>/.ssh \ | ||
&& chmod 0700 /home/<%= @username %>/.ssh \ | ||
&& echo '<%= IO.read(@public_key).strip %>' >> /home/<%= @username %>/.ssh/authorized_keys \ | ||
&& chown <%= @username %> /home/<%= @username %>/.ssh/authorized_keys \ | ||
&& chmod 0600 /home/<%= @username %>/.ssh/authorized_keys \ | ||
&& export LANG="en_US.UTF-8" && echo "LANG=\"en_US.UTF-8\"" > /etc/locale.conf \ | ||
&& cd /lib/systemd/system/sysinit.target.wants/; ls | grep -v systemd-tmpfiles-setup | /usr/bin/xargs rm -f $1 \ | ||
&& /usr/bin/rm -f /lib/systemd/system/multi-user.target.wants/* \ | ||
&& /usr/bin/rm -f /etc/systemd/system/*.wants/* \ | ||
&& /usr/bin/rm -f /lib/systemd/system/local-fs.target.wants/* \ | ||
&& /usr/bin/rm -f /lib/systemd/system/sockets.target.wants/*udev* \ | ||
&& /usr/bin/rm -f /lib/systemd/system/sockets.target.wants/*initctl* \ | ||
&& /usr/bin/rm -f /lib/systemd/system/basic.target.wants/* \ | ||
&& /usr/bin/rm -f /lib/systemd/system/anaconda.target.wants/* \ | ||
&& /usr/bin/rm -f /lib/systemd/system/plymouth* \ | ||
&& /usr/bin/rm -f /lib/systemd/system/systemd-update-utmp* \ | ||
&& 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/sshd.service /etc/systemd/system/multi-user.target.wants/sshd.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
FROM ubuntu:latest | ||
|
||
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 <%= @username %>; then \ | ||
useradd -d /home/<%= @username %> -m -s /bin/bash -p '*' <%= @username %>; \ | ||
fi \ | ||
&& echo "<%= @username %> ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \ | ||
&& echo "Defaults !requiretty" >> /etc/sudoers \ | ||
&& mkdir -p /home/<%= @username %>/.ssh \ | ||
&& chown -R <%= @username %> /home/<%= @username %>/.ssh \ | ||
&& chmod 0700 /home/<%= @username %>/.ssh \ | ||
&& echo '<%= IO.read(@public_key).strip %>' >> /home/<%= @username %>/.ssh/authorized_keys \ | ||
&& chown <%= @username %> /home/<%= @username %>/.ssh/authorized_keys \ | ||
&& chmod 0600 /home/<%= @username %>/.ssh/authorized_keys \ | ||
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && /usr/sbin/locale-gen \ | ||
&& cd /lib/systemd/system/sysinit.target.wants/; ls | grep -v systemd-tmpfiles-setup | 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/sshd.service /etc/systemd/system/multi-user.target.wants/sshd.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
FROM ubuntu:rolling | ||
|
||
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 <%= @username %>; then \ | ||
useradd -d /home/<%= @username %> -m -s /bin/bash -p '*' <%= @username %>; \ | ||
fi \ | ||
&& echo "<%= @username %> ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \ | ||
&& echo "Defaults !requiretty" >> /etc/sudoers \ | ||
&& mkdir -p /home/<%= @username %>/.ssh \ | ||
&& chown -R <%= @username %> /home/<%= @username %>/.ssh \ | ||
&& chmod 0700 /home/<%= @username %>/.ssh \ | ||
&& echo '<%= IO.read(@public_key).strip %>' >> /home/<%= @username %>/.ssh/authorized_keys \ | ||
&& chown <%= @username %> /home/<%= @username %>/.ssh/authorized_keys \ | ||
&& chmod 0600 /home/<%= @username %>/.ssh/authorized_keys \ | ||
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && /usr/sbin/locale-gen \ | ||
&& cd /lib/systemd/system/sysinit.target.wants/; ls | grep -v systemd-tmpfiles-setup | 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/sshd.service /etc/systemd/system/multi-user.target.wants/sshd.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" ] |
Oops, something went wrong.