You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Secrets that I need to provide are present as exported environment variables on the build server.
Rather than having to create files on the build server (and thus risk the secrets being left behind on the build server), I would like to specify the secret directly in the command line like:
Make a temporary file containing the secret, for example with printf "$mysecret" > mysecretfile and use src=mysecretfile and make sure to delete this file afterwards.
Use process subsitution (only available in some shells), in bash it would look like src=<(printf "$mysecret")
The first approach is somewhat unsafe since you can forget to remove this file. The second approach (which I use at the moment) only works in certain shells, for example not possible in POSIX shell.
Therefore, I think something value=$mysecret would add to the user experience and safety in some cases.
Edit: I found that part of the code responsible is in cli/opts/secret.go.
#5 [2/2] RUN --mount=type=secret,id=foo-token echo "the secret is: $(cat /run/secrets/foo-token)"
#5 sha256:0197aa18712af0632dd5950200e51a7afb3d6e4fd310164f5be4f2daa0212b8e
#5 0.400 the secret is: topsecret
#5 DONE 0.4s
I don't think we should add support for providing the value in-line (value=). Doing so would be worse (from a security perspective), because the value would show up in logs, (bash)history, etc.
Passing the value through stdin could've been an alternative, but unfortunately is not an option for docker build, as it already accepts stdin as input for the Dockerfile and/or build-context, besides not being possible when passing multiple secrets.
Description
Secrets that I need to provide are present as exported environment variables on the build server.
Rather than having to create files on the build server (and thus risk the secrets being left behind on the build server), I would like to specify the secret directly in the command line like:
The text was updated successfully, but these errors were encountered: