Security, topic 32 of 41
Secrets
A secret copied into an image, set with ENV or passed as a build ARG stays in the image's layers or history, for anyone who pulls it. A secret needed at build time, such as a token for a private package registry, goes in with RUN --mount=type=secret, which is never written to a layer.
At run time, mount secrets as files, as Compose's secrets do, rather than passing them as variables that docker inspect and crash reports show.
On Opsfolk
Nothing of ours for this topic yet: an article is on its way.
Elsewhere
- Build secretsOfficial
- Secrets in ComposeOfficial