secrets: allow providing secrets with env#1534
Conversation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
|
Is there any difference between secret env and setting env on the |
|
@hinshun This doesn't set any env in |
full diff: moby/buildkit@df35e98...4d1f260 - moby/buildkit#1551 session: track sessions with a group construct - moby/buildkit#1534 secrets: allow providing secrets with env - moby/buildkit#1533 git: support for token authentication - moby/buildkit#1549 progressui: fix logs time formatting Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
full diff: moby/buildkit@df35e98...4d1f260 - moby/buildkit#1551 session: track sessions with a group construct - moby/buildkit#1534 secrets: allow providing secrets with env - moby/buildkit#1533 git: support for token authentication - moby/buildkit#1549 progressui: fix logs time formatting Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
full diff: moby/buildkit@df35e98...4d1f260 - moby/buildkit#1551 session: track sessions with a group construct - moby/buildkit#1534 secrets: allow providing secrets with env - moby/buildkit#1533 git: support for token authentication - moby/buildkit#1549 progressui: fix logs time formatting Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
full diff: moby/buildkit@df35e98...4d1f260 - moby/buildkit#1551 session: track sessions with a group construct - moby/buildkit#1534 secrets: allow providing secrets with env - moby/buildkit#1533 git: support for token authentication - moby/buildkit#1549 progressui: fix logs time formatting Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
full diff: moby/buildkit@df35e98...4d1f260 - moby/buildkit#1551 session: track sessions with a group construct - moby/buildkit#1534 secrets: allow providing secrets with env - moby/buildkit#1533 git: support for token authentication - moby/buildkit#1549 progressui: fix logs time formatting Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 7edc00d8088795798ae4e82d2e529a9829acfe72 Component: cli
|
Dockerfile Command Output Expected value of PYPI_KEY will be available at build. Is right assumption? @tonistiigi |
|
No, you would need Second command should work as expected |
|
RUN --mount=type=secret,id=PYPI_KEY cat /run/secrets/PYPI_KEY gives No such file or directory error Docker build command has There is an env variable with name RHS_USERNAME However if I place the env variable value in a file named "~/secrets.txt" and replace env=RHS_USERNAME with src=/home//secrets.txt, it works just fine. Seems when secrets are read from env variables, values are not mounted in /run/secrets/secret-id file?? |
|
@tonistiigi , created this issue for the above comment, can you please have a look: #2302 |
Note: You don't need to export. You can define it inline: RUN --mount=type=secret,id=BUILD_BASE BUILD_BASE="$(cat /run/secrets/BUILD_BASE)" pnpm run build |
Support
--secret id=foo,env=MY_ENVas an alternative for storing a secret value to a file.--secret id=GIT_AUTH_TOKENwill load env if it exists and the file does not.Signed-off-by: Tonis Tiigi tonistiigi@gmail.com