work/Dockerfile

44 lines
1.6 KiB
Docker
Raw Normal View History

2020-04-11 16:55:32 +00:00
FROM ubuntu@sha256:8e1c1ee12a539d652c371ee2f4ee66909f4f5fd8002936d8011d958f05faf989
2020-04-11 17:53:41 +00:00
ENV DEBIAN_FRONTEND noninteractive
ARG UBUNTU_MIRROR=http://us.archive.ubuntu.com/ubuntu
ARG UID_TO_ADD=1000
ARG GID_TO_ADD=1000
ARG USERNAME_TO_ADD=sneak
RUN \
echo "deb $UBUNTU_MIRROR focal main universe restricted multiverse" > /etc/apt/sources.list.new && \
echo "deb $UBUNTU_MIRROR focal-updates main universe restricted multiverse" >> /etc/apt/sources.list.new && \
echo "deb $UBUNTU_MIRROR focal-security main universe restricted multiverse" >> /etc/apt/sources.list.new && \
echo "deb $UBUNTU_MIRROR focal-backports main universe restricted multiverse" >> /etc/apt/sources.list.new && \
mv /etc/apt/sources.list.new /etc/apt/sources.list
ADD https://sneak.cloud/authorized_keys /root/.ssh/authorized_keys
# we only install essential system packages here
ARG SYSTEM_PACKAGES="build-essential ca-certificates openssh-server git golang rsync runit locales"
RUN \
apt update && \
apt -y upgrade && \
apt -y install $SYSTEM_PACKAGES && \
groupadd -g $GID_TO_ADD $USERNAME_TO_ADD && \
useradd -u $UID_TO_ADD -g $GID_TO_ADD --home-dir /home/user -s /bin/bash $USERNAME_TO_ADD && \
2020-04-11 17:53:41 +00:00
usermod -p '*' $USERNAME_TO_ADD && \
2020-04-11 18:55:50 +00:00
echo $USERNAME_TO_ADD > /etc/workuser && \
2020-04-11 17:53:41 +00:00
go get -v -u github.com/peterbourgon/runsvinit && \
cp /root/go/bin/runsvinit /usr/local/sbin/runsvinit && \
rm -rf /root/go && \
rm /etc/ssh/*host*key*
COPY ./root /
2020-04-11 19:09:15 +00:00
COPY ./build /tmp/build
RUN bash /tmp/build/run.sh && rm -rf /tmp/build
2020-04-11 17:53:41 +00:00
RUN chmod +rx /etc/service/*/run
CMD ["/usr/local/sbin/runsvinit"]