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 :=
|
.DEFAULT_GOAL :=
|
||||||
.PHONY: default
|
.PHONY: default
|
||||||
default: \
|
default: \
|
||||||
toolchain \
|
|
||||||
tools \
|
tools \
|
||||||
apply
|
apply
|
||||||
|
|
||||||
|
@ -28,13 +27,16 @@ default: \
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(CACHE_DIR)
|
rm -rf $(CACHE_DIR)
|
||||||
|
|
||||||
|
out:
|
||||||
|
mkdir out
|
||||||
|
|
||||||
.PHONY: update-tools
|
.PHONY: update-tools
|
||||||
update-tools:
|
update-tools:
|
||||||
./src/make/update.sh
|
./src/make/update.sh
|
||||||
|
|
||||||
.PHONY: shell
|
.PHONY: shell
|
||||||
shell: out/tools-image.digest
|
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
|
.PHONY: credentials
|
||||||
credentials: \
|
credentials: \
|
||||||
|
@ -137,11 +139,12 @@ GPG_TTY ?= $(shell tty)
|
||||||
|
|
||||||
define run-container
|
define run-container
|
||||||
docker run -it $(1) \
|
docker run -it $(1) \
|
||||||
-e GPG_TTY="$(GPG_TTY)" \
|
-v $$PWD/.bashrc:/home/user/.bashrc:ro \
|
||||||
-v $(shell gpgconf --list-dirs agent-socket):/root/.gnupg/S.gpg-agent:ro \
|
-v $(shell gpgconf --list-dirs socketdir)/:/run/user/1000/gnupg/:ro \
|
||||||
-v $(shell gpgconf --list-dirs homedir):/root/.gnupg:rw \
|
-v $(shell gpgconf --list-dirs homedir):/home/user/.gnupg:rw \
|
||||||
$(2) \
|
-e SSH_AUTH_SOCK=/run/user/1000/gnupg/$(shell basename $(shell gpgconf --list-dirs agent-ssh-socket)) \
|
||||||
$(3)
|
--entrypoint $(3) \
|
||||||
|
$(2)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
.PHONY: plan
|
.PHONY: plan
|
||||||
|
|
Loading…
Reference in New Issue