diff --git a/Dockerfile b/Dockerfile index 283869c..cc422c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM ubuntu@sha256:5747316366b8cc9e3021cd7286f42b2d6d81e3d743e2ab571f55bcd5df788 ENV DEBIAN_FRONTEND noninteractive -ARG UBUNTU_MIRROR=http://archive.ubuntu.com/ubuntu +ARG UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt ARG UID_TO_ADD=1000 ARG GID_TO_ADD=1000 @@ -22,7 +22,6 @@ RUN \ 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 @@ -189,8 +188,8 @@ USER root ENV HOME /root COPY ./root / -COPY ./build /tmp/build - +COPY ./root.sh /tmp/build/root.sh +COPY ./user.sh /tmp/build/user.sh RUN bash /tmp/build/root.sh USER user diff --git a/Makefile b/Makefile index bb8b917..5093552 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,25 @@ -#export DOCKER_HOST := ssh://las1.eeqj.de +export DOCKER_HOST := ssh://root@datavi.be -.PHONY: build +default: start + +.PHONY: build run + +start: + make build + make run build: - docker build \ - --build-arg UBUNTU_MIRROR=http://us.archive.ubuntu.com/ubuntu \ - -t sneak/work \ - . \ - 2>&1 | tee -a build.log + docker build -t sneak/work . + +run: + -docker rm -f work + docker run \ + -d \ + --name work \ + -v /:/hostroot \ + -v /home/sneak:/hosthome \ + -v /var/run/docker.sock:/var/run/docker.sock \ + sneak/work enter: docker run -ti --rm=true -e HOME=/home/user -e USER=user --user=user -v /home/sneak:/home/user/.home sneak/work /home/user/.nix-profile/bin/zsh -l diff --git a/build/root.sh b/root.sh similarity index 100% rename from build/root.sh rename to root.sh diff --git a/root/home/user/.config/nixpkgs/config.nix b/root/home/sneak/.config/nixpkgs/config.nix similarity index 70% rename from root/home/user/.config/nixpkgs/config.nix rename to root/home/sneak/.config/nixpkgs/config.nix index bc0cef1..579079e 100644 --- a/root/home/user/.config/nixpkgs/config.nix +++ b/root/home/sneak/.config/nixpkgs/config.nix @@ -10,23 +10,35 @@ coreutils ctags curl + docker ffmpeg gdb git gnupg + gnupg go + gpg-agent jq nix-prefetch-scripts + nmap openssh + par2cmdline + pinentry-mac + pv pwgen qemu + rsync tmux + tor tree vim + vimpager weechat wget + whois + xz zsh - ]; + ]; }; }; diff --git a/root/home/user/.local/profile.d/099.locale.sh b/root/home/sneak/.local/profile.d/099.locale.sh similarity index 100% rename from root/home/user/.local/profile.d/099.locale.sh rename to root/home/sneak/.local/profile.d/099.locale.sh diff --git a/root/home/user/.local/profile.d/100.aliases.sh b/root/home/sneak/.local/profile.d/100.aliases.sh similarity index 100% rename from root/home/user/.local/profile.d/100.aliases.sh rename to root/home/sneak/.local/profile.d/100.aliases.sh diff --git a/root/home/user/.local/profile.d/100.editor.sh b/root/home/sneak/.local/profile.d/100.editor.sh similarity index 100% rename from root/home/user/.local/profile.d/100.editor.sh rename to root/home/sneak/.local/profile.d/100.editor.sh diff --git a/root/home/user/.local/profile.d/100.gopath.sh b/root/home/sneak/.local/profile.d/100.gopath.sh similarity index 100% rename from root/home/user/.local/profile.d/100.gopath.sh rename to root/home/sneak/.local/profile.d/100.gopath.sh diff --git a/root/home/user/.local/profile.d/100.path.sh b/root/home/sneak/.local/profile.d/100.path.sh similarity index 100% rename from root/home/user/.local/profile.d/100.path.sh rename to root/home/sneak/.local/profile.d/100.path.sh diff --git a/root/home/user/.local/profile.d/100.spyware.sh b/root/home/sneak/.local/profile.d/100.spyware.sh similarity index 100% rename from root/home/user/.local/profile.d/100.spyware.sh rename to root/home/sneak/.local/profile.d/100.spyware.sh diff --git a/root/home/user/.local/profile.d/200.gitconfig.sh b/root/home/sneak/.local/profile.d/200.gitconfig.sh similarity index 100% rename from root/home/user/.local/profile.d/200.gitconfig.sh rename to root/home/sneak/.local/profile.d/200.gitconfig.sh diff --git a/root/home/user/.local/profile.d/200.pyenv.sh b/root/home/sneak/.local/profile.d/200.pyenv.sh similarity index 100% rename from root/home/user/.local/profile.d/200.pyenv.sh rename to root/home/sneak/.local/profile.d/200.pyenv.sh diff --git a/root/home/user/.local/profile.d/300.nvm.sh b/root/home/sneak/.local/profile.d/300.nvm.sh similarity index 100% rename from root/home/user/.local/profile.d/300.nvm.sh rename to root/home/sneak/.local/profile.d/300.nvm.sh diff --git a/root/home/user/.local/profile.d/999.bash-history.sh b/root/home/sneak/.local/profile.d/999.bash-history.sh similarity index 100% rename from root/home/user/.local/profile.d/999.bash-history.sh rename to root/home/sneak/.local/profile.d/999.bash-history.sh diff --git a/root/home/user/.local/profile.d/999.kubectl.sh b/root/home/sneak/.local/profile.d/999.kubectl.sh similarity index 100% rename from root/home/user/.local/profile.d/999.kubectl.sh rename to root/home/sneak/.local/profile.d/999.kubectl.sh diff --git a/root/home/user/.local/profile.d/999.zsh-git-prompt.sh b/root/home/sneak/.local/profile.d/999.zsh-git-prompt.sh similarity index 100% rename from root/home/user/.local/profile.d/999.zsh-git-prompt.sh rename to root/home/sneak/.local/profile.d/999.zsh-git-prompt.sh diff --git a/root/home/user/.local/profile.d/999.zsh-ls-linux-colors.sh b/root/home/sneak/.local/profile.d/999.zsh-ls-linux-colors.sh similarity index 100% rename from root/home/user/.local/profile.d/999.zsh-ls-linux-colors.sh rename to root/home/sneak/.local/profile.d/999.zsh-ls-linux-colors.sh diff --git a/root/home/user/.toprc b/root/home/sneak/.toprc similarity index 100% rename from root/home/user/.toprc rename to root/home/sneak/.toprc diff --git a/root/home/user/.vimrc b/root/home/sneak/.vimrc similarity index 100% rename from root/home/user/.vimrc rename to root/home/sneak/.vimrc diff --git a/root/home/user/.zshrc b/root/home/sneak/.zshrc similarity index 100% rename from root/home/user/.zshrc rename to root/home/sneak/.zshrc diff --git a/build/user.sh b/user.sh similarity index 100% rename from build/user.sh rename to user.sh