SEANK.H.LIAO

docker build secrets

secrets for docker build

docker build

It's 12020 and we finally have a supported way of using secrets when building docker containers.

secret files

Enable buildkit and RUN --mount=type=secret,id=mysecret cat /run/secrets/mysecret. Specify on the command line with docker build --secret id=mysecret,src=secret.txt Useful for, say, go with netrc:

1RUN --mount=type=secret,id=netrc,dst=/root/.netrc go get example.com/my/private/repo

ssh agent forwarding

someone else can probably explain it better since I don't use ssh-agent

tldr is docker build --ssh ...:

1RUN  --mount=type=ssh go get example.com/my/private/repo.git

other

still waiting for a way to mount build caches