Pass in gpg agent and socket to user, add stack repo to container

This commit is contained in:
Danny Grove 2025-07-14 23:19:55 -07:00
parent 32697576a0
commit 6c19aed9aa
Signed by: danny
GPG Key ID: E1F4160251DB4C2E
1 changed files with 10 additions and 7 deletions

View File

@ -20,7 +20,6 @@ EXTRA_ARGS :=
.DEFAULT_GOAL :=
.PHONY: default
default: \
toolchain \
tools \
apply
@ -28,13 +27,16 @@ default: \
clean:
rm -rf $(CACHE_DIR)
out:
mkdir out
.PHONY: update-tools
update-tools:
./src/make/update.sh
.PHONY: shell
shell: out/tools-image.digest
$(call run-container, -v ./secrets:/secrets, $(shell cat $<), bin/sh)
$(call run-container, -v $${PWD}:/home/user/stack:rw, $(shell cat $<), /bin/bash)
.PHONY: credentials
credentials: \
@ -137,11 +139,12 @@ GPG_TTY ?= $(shell tty)
define run-container
docker run -it $(1) \
-e GPG_TTY="$(GPG_TTY)" \
-v $(shell gpgconf --list-dirs agent-socket):/root/.gnupg/S.gpg-agent:ro \
-v $(shell gpgconf --list-dirs homedir):/root/.gnupg:rw \
$(2) \
$(3)
-v $$PWD/.bashrc:/home/user/.bashrc:ro \
-v $(shell gpgconf --list-dirs socketdir)/:/run/user/1000/gnupg/:ro \
-v $(shell gpgconf --list-dirs homedir):/home/user/.gnupg:rw \
-e SSH_AUTH_SOCK=/run/user/1000/gnupg/$(shell basename $(shell gpgconf --list-dirs agent-ssh-socket)) \
--entrypoint $(3) \
$(2)
endef
.PHONY: plan