docker build --secret id=mysecret,src=./secret.txt .

Category: Docker

docker build --secret id=mysecret,src=./secret.txt .

Pass a build-time secret file without baking it into a layer

Passes a secret file to the build without baking its contents into any image layer — secure for API keys.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.