LinuxCommandLibrary

docker-secret

manage sensitive data in Docker Swarm

TLDR

Create secret from file

$ docker secret create [name] [file]
copy
Create secret from stdin
$ echo "[secret_value]" | docker secret create [name] -
copy
List secrets
$ docker secret ls
copy
Inspect a secret
$ docker secret inspect [name]
copy
Remove a secret
$ docker secret rm [name]
copy

SYNOPSIS

docker secret command [options]

DESCRIPTION

docker secret manages Swarm secrets, which are sensitive data like passwords, certificates, or API keys. Secrets are encrypted and only available to services that need them. The secret content itself is never exposed in inspect output, only metadata. Secrets are mounted into service containers as files in /run/secrets.

SUBCOMMANDS

create

Create a secret from file or STDIN.
ls
List secrets.
inspect
Display detailed information.
rm
Remove secrets.

CAVEATS

Only available in Swarm mode. Secrets cannot be updated; create a new version and rotate services.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community