Docker

Build Secret

A build secret is sensitive data made available temporarily to a build step through a dedicated secret mechanism. Unlike build arguments or copied files, properly used secret mounts avoid persisting the secret in image layers.

Also known as: secret mount

Why it matters

Temporary secret injection helps avoid embedding credentials in distributed images.

Practical example

Mount a package registry token only for the dependency-install instruction that requires authentication.

Related terms

Sources

Definition reviewed .

Start with $10 in free credits

Change the runner label in your workflow and keep the rest of your GitHub Actions setup. Runner time is billed per minute.

← Return to glossary