diff --git a/Dockerfile b/Dockerfile index cc422c3..5d72fd8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,62 +1,4 @@ -# focal as of 2020-04-23 -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 +FROM sneak/workbase # nix for pkgs pls RUN mkdir /nix && chown user:user /nix diff --git a/Makefile b/Makefile index 5093552..6b8f90f 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ start: make run build: + cd base && make build docker build -t sneak/work . run: diff --git a/base/Dockerfile b/base/Dockerfile new file mode 100644 index 0000000..9409839 --- /dev/null +++ b/base/Dockerfile @@ -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"] diff --git a/base/Makefile b/base/Makefile new file mode 100644 index 0000000..7b471dc --- /dev/null +++ b/base/Makefile @@ -0,0 +1,6 @@ +default: build + +.PHONY: build + +build: + docker build -t sneak/workbase . diff --git a/root/home/sneak/.config/nixpkgs/config.nix b/root/home/user/.config/nixpkgs/config.nix similarity index 100% rename from root/home/sneak/.config/nixpkgs/config.nix rename to root/home/user/.config/nixpkgs/config.nix diff --git a/root/home/sneak/.local/profile.d/099.locale.sh b/root/home/user/.local/profile.d/099.locale.sh similarity index 100% rename from root/home/sneak/.local/profile.d/099.locale.sh rename to root/home/user/.local/profile.d/099.locale.sh diff --git a/root/home/sneak/.local/profile.d/100.aliases.sh b/root/home/user/.local/profile.d/100.aliases.sh similarity index 100% rename from root/home/sneak/.local/profile.d/100.aliases.sh rename to root/home/user/.local/profile.d/100.aliases.sh diff --git a/root/home/sneak/.local/profile.d/100.editor.sh b/root/home/user/.local/profile.d/100.editor.sh similarity index 100% rename from root/home/sneak/.local/profile.d/100.editor.sh rename to root/home/user/.local/profile.d/100.editor.sh diff --git a/root/home/sneak/.local/profile.d/100.gopath.sh b/root/home/user/.local/profile.d/100.gopath.sh similarity index 100% rename from root/home/sneak/.local/profile.d/100.gopath.sh rename to root/home/user/.local/profile.d/100.gopath.sh diff --git a/root/home/sneak/.local/profile.d/100.path.sh b/root/home/user/.local/profile.d/100.path.sh similarity index 100% rename from root/home/sneak/.local/profile.d/100.path.sh rename to root/home/user/.local/profile.d/100.path.sh diff --git a/root/home/sneak/.local/profile.d/100.spyware.sh b/root/home/user/.local/profile.d/100.spyware.sh similarity index 100% rename from root/home/sneak/.local/profile.d/100.spyware.sh rename to root/home/user/.local/profile.d/100.spyware.sh diff --git a/root/home/sneak/.local/profile.d/200.gitconfig.sh b/root/home/user/.local/profile.d/200.gitconfig.sh similarity index 100% rename from root/home/sneak/.local/profile.d/200.gitconfig.sh rename to root/home/user/.local/profile.d/200.gitconfig.sh diff --git a/root/home/sneak/.local/profile.d/200.pyenv.sh b/root/home/user/.local/profile.d/200.pyenv.sh similarity index 100% rename from root/home/sneak/.local/profile.d/200.pyenv.sh rename to root/home/user/.local/profile.d/200.pyenv.sh diff --git a/root/home/sneak/.local/profile.d/300.nvm.sh b/root/home/user/.local/profile.d/300.nvm.sh similarity index 100% rename from root/home/sneak/.local/profile.d/300.nvm.sh rename to root/home/user/.local/profile.d/300.nvm.sh diff --git a/root/home/sneak/.local/profile.d/999.bash-history.sh b/root/home/user/.local/profile.d/999.bash-history.sh similarity index 100% rename from root/home/sneak/.local/profile.d/999.bash-history.sh rename to root/home/user/.local/profile.d/999.bash-history.sh diff --git a/root/home/sneak/.local/profile.d/999.kubectl.sh b/root/home/user/.local/profile.d/999.kubectl.sh similarity index 100% rename from root/home/sneak/.local/profile.d/999.kubectl.sh rename to root/home/user/.local/profile.d/999.kubectl.sh diff --git a/root/home/sneak/.local/profile.d/999.zsh-git-prompt.sh b/root/home/user/.local/profile.d/999.zsh-git-prompt.sh similarity index 100% rename from root/home/sneak/.local/profile.d/999.zsh-git-prompt.sh rename to root/home/user/.local/profile.d/999.zsh-git-prompt.sh diff --git a/root/home/sneak/.local/profile.d/999.zsh-ls-linux-colors.sh b/root/home/user/.local/profile.d/999.zsh-ls-linux-colors.sh similarity index 100% rename from root/home/sneak/.local/profile.d/999.zsh-ls-linux-colors.sh rename to root/home/user/.local/profile.d/999.zsh-ls-linux-colors.sh diff --git a/root/home/sneak/.toprc b/root/home/user/.toprc similarity index 100% rename from root/home/sneak/.toprc rename to root/home/user/.toprc diff --git a/root/home/sneak/.vimrc b/root/home/user/.vimrc similarity index 100% rename from root/home/sneak/.vimrc rename to root/home/user/.vimrc diff --git a/root/home/sneak/.zshrc b/root/home/user/.zshrc similarity index 100% rename from root/home/sneak/.zshrc rename to root/home/user/.zshrc