From 8af0b77f46cff88d5e8f8ebcb3b73a3eee293568 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Fri, 18 Jun 2021 01:59:53 +0700 Subject: [PATCH] Mount less files into tools container --- docs/todo.md | 1 - tools/Dockerfile | 5 +---- tools/Makefile | 10 ++++++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/docs/todo.md b/docs/todo.md index bf80a4b2..3abcaf43 100644 --- a/docs/todo.md +++ b/docs/todo.md @@ -1,6 +1,5 @@ # TODO -- [(bug) Fix wireguard secrets](../apps/resources/wireguard.yaml#L17) - [(feature) Add lint checks for everything](../Makefile#L29) - [(feature) Simple script to backup everything](../scripts/backup.sh#L3) - [(feature) Simple script to restore everything](../scripts/restore.sh#L3) diff --git a/tools/Dockerfile b/tools/Dockerfile index 68be9a19..e80ab13f 100644 --- a/tools/Dockerfile +++ b/tools/Dockerfile @@ -16,7 +16,4 @@ RUN yes | pacman --sync --refresh \ p7zip \ python \ python-netaddr \ - terraform \ - zsh - -CMD [ "/bin/zsh" ] + terraform diff --git a/tools/Makefile b/tools/Makefile index e3616eab..d86b1e40 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,11 +1,13 @@ .POSIX: +WORKDIR = /usr/local/src TAG = homelab-tools default: build run build: - docker build . --tag ${TAG} + docker build . \ + --tag ${TAG} run: docker run \ @@ -14,8 +16,8 @@ run: --tty \ --network host \ --env "TERM=${TERM}" \ - --env "HOME=${HOME}" \ - --volume "${HOME}:${HOME}" \ + --volume "$(shell pwd)/..:${WORKDIR}" \ + --volume "${HOME}/.ssh/id_ed25519.pub:/root/.ssh/id_ed25519.pub" \ --volume "/var/run/docker.sock:/var/run/docker.sock" \ - --workdir "$(shell pwd)/.." \ + --workdir "${WORKDIR}" \ ${TAG}