Created
June 20, 2023 11:47
-
-
Save alexrashed/70b0b21de74a269d710441d1c3f00e96 to your computer and use it in GitHub Desktop.
Dockerfile buildx secret env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GITHUB_TOKEN="very secret github token!" docker buildx build --progress plain --no-cache --secret id=GITHUB_TOKEN . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# syntax=docker/dockerfile:1.3 | |
FROM busybox | |
RUN --mount=type=secret,id=GITHUB_TOKEN echo "This is the token: $(cat /run/secrets/GITHUB_TOKEN)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment