Pass in gpg agent and socket to user, add stack repo to container
This commit is contained in:
parent
32697576a0
commit
6c19aed9aa
17
Makefile
17
Makefile
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue