working environment
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.5KB

  1. FROM ubuntu@sha256:8e1c1ee12a539d652c371ee2f4ee66909f4f5fd8002936d8011d958f05faf989
  2. ENV DEBIAN_FRONTEND noninteractive
  3. ARG UBUNTU_MIRROR=http://us.archive.ubuntu.com/ubuntu
  4. ARG UID_TO_ADD=1000
  5. ARG GID_TO_ADD=1000
  6. ARG USERNAME_TO_ADD=sneak
  7. RUN \
  8. echo "deb $UBUNTU_MIRROR focal main universe restricted multiverse" > /etc/apt/sources.list.new && \
  9. echo "deb $UBUNTU_MIRROR focal-updates main universe restricted multiverse" >> /etc/apt/sources.list.new && \
  10. echo "deb $UBUNTU_MIRROR focal-security main universe restricted multiverse" >> /etc/apt/sources.list.new && \
  11. echo "deb $UBUNTU_MIRROR focal-backports main universe restricted multiverse" >> /etc/apt/sources.list.new && \
  12. mv /etc/apt/sources.list.new /etc/apt/sources.list
  13. ADD https://sneak.cloud/authorized_keys /root/.ssh/authorized_keys
  14. # we only install essential system packages here
  15. ARG SYSTEM_PACKAGES="build-essential ca-certificates openssh-server git golang rsync runit locales"
  16. RUN \
  17. apt update && \
  18. apt -y upgrade && \
  19. apt -y install $SYSTEM_PACKAGES && \
  20. groupadd -g $GID_TO_ADD $USERNAME_TO_ADD && \
  21. useradd -u $UID_TO_ADD -g $GID_TO_ADD -s /bin/bash $USERNAME_TO_ADD && \
  22. usermod -p '*' $USERNAME_TO_ADD && \
  23. go get -v -u github.com/peterbourgon/runsvinit && \
  24. cp /root/go/bin/runsvinit /usr/local/sbin/runsvinit && \
  25. rm -rf /root/go && \
  26. rm /etc/ssh/*host*key*
  27. COPY ./setup /tmp/setup
  28. RUN bash /tmp/setup/run.sh
  29. COPY ./root /
  30. RUN chmod +rx /etc/service/*/run
  31. CMD ["/usr/local/sbin/runsvinit"]