next #1
60
Dockerfile
60
Dockerfile
|
@ -1,62 +1,4 @@
|
||||||
# focal as of 2020-04-23
|
FROM sneak/workbase
|
||||||
FROM ubuntu@sha256:5747316366b8cc9e3021cd7286f42b2d6d81e3d743e2ab571f55bcd5df788cc8
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
|
||||||
|
|
||||||
ARG UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt
|
|
||||||
|
|
||||||
ARG UID_TO_ADD=1000
|
|
||||||
ARG GID_TO_ADD=1000
|
|
||||||
ARG USERNAME_TO_ADD=user
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
groupadd -g $GID_TO_ADD $USERNAME_TO_ADD && \
|
|
||||||
groupadd nixbld && \
|
|
||||||
useradd -u $UID_TO_ADD -g $GID_TO_ADD --home-dir /home/user -m -s /bin/bash $USERNAME_TO_ADD && \
|
|
||||||
usermod -p '*' $USERNAME_TO_ADD
|
|
||||||
|
|
||||||
ADD https://sneak.cloud/authorized_keys /root/.ssh/authorized_keys
|
|
||||||
ADD https://sneak.cloud/authorized_keys /home/user/.ssh/authorized_keys
|
|
||||||
|
|
||||||
# we only install essential system packages here
|
|
||||||
ARG SYSTEM_PACKAGES="\
|
|
||||||
anacron \
|
|
||||||
apt-transport-https \
|
|
||||||
build-essential \
|
|
||||||
byobu \
|
|
||||||
ca-certificates \
|
|
||||||
cron \
|
|
||||||
cronic \
|
|
||||||
curl \
|
|
||||||
git \
|
|
||||||
golang \
|
|
||||||
locales \
|
|
||||||
openssh-server \
|
|
||||||
rsync \
|
|
||||||
runit \
|
|
||||||
sudo \
|
|
||||||
tmux \
|
|
||||||
"
|
|
||||||
|
|
||||||
RUN /bin/bash -c "echo -e 'Y\n\n' | /usr/local/sbin/unminimize"
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
apt update && \
|
|
||||||
apt -y upgrade && \
|
|
||||||
apt -y install $SYSTEM_PACKAGES && \
|
|
||||||
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* && \
|
|
||||||
apt -y purge golang && \
|
|
||||||
apt -y autoremove
|
|
||||||
|
|
||||||
# nix for pkgs pls
|
# nix for pkgs pls
|
||||||
RUN mkdir /nix && chown user:user /nix
|
RUN mkdir /nix && chown user:user /nix
|
||||||
|
|
1
Makefile
1
Makefile
|
@ -9,6 +9,7 @@ start:
|
||||||
make run
|
make run
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
cd base && make build
|
||||||
docker build -t sneak/work .
|
docker build -t sneak/work .
|
||||||
|
|
||||||
run:
|
run:
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
# focal as of 2020-04-23
|
||||||
|
FROM ubuntu:focal-20201008
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
|
ARG UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt
|
||||||
|
|
||||||
|
ARG UID_TO_ADD=1000
|
||||||
|
ARG GID_TO_ADD=1000
|
||||||
|
ARG USERNAME_TO_ADD=user
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
groupadd -g $GID_TO_ADD $USERNAME_TO_ADD && \
|
||||||
|
groupadd nixbld && \
|
||||||
|
useradd -u $UID_TO_ADD -g $GID_TO_ADD --home-dir /home/user -m -s /bin/bash $USERNAME_TO_ADD && \
|
||||||
|
usermod -p '*' $USERNAME_TO_ADD
|
||||||
|
|
||||||
|
ADD https://sneak.cloud/authorized_keys /root/.ssh/authorized_keys
|
||||||
|
ADD https://sneak.cloud/authorized_keys /home/user/.ssh/authorized_keys
|
||||||
|
|
||||||
|
RUN apt update && apt install -y \
|
||||||
|
anacron \
|
||||||
|
apt-transport-https \
|
||||||
|
build-essential \
|
||||||
|
ca-certificates \
|
||||||
|
cron \
|
||||||
|
cronic \
|
||||||
|
curl \
|
||||||
|
git \
|
||||||
|
golang \
|
||||||
|
locales \
|
||||||
|
openssh-server \
|
||||||
|
rsync \
|
||||||
|
runit \
|
||||||
|
sudo
|
||||||
|
|
||||||
|
RUN /bin/bash -c "echo -e 'Y\n\n' | /usr/local/sbin/unminimize"
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
go get -v -u github.com/peterbourgon/runsvinit && \
|
||||||
|
cp /root/go/bin/runsvinit /usr/local/sbin/runsvinit && \
|
||||||
|
rm -rf /root/go && \
|
||||||
|
apt -y purge golang && \
|
||||||
|
apt -y autoremove
|
||||||
|
|
||||||
|
CMD ["/usr/local/sbin/runsvinit"]
|
|
@ -0,0 +1,6 @@
|
||||||
|
default: build
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build -t sneak/workbase .
|
Loading…
Reference in New Issue