If you have been working with Docker secrets locally, you may have noticed two commands that sound similar but behave very differently: docker pass and docker secret.

At first glance, both appear to solve the same problem: keeping sensitive values such as API keys, tokens, and database passwords out of your source code. But they are designed for different environments and different workflows.

The short version is this:

docker pass is a local developer secret helper. docker secret is Docker Swarm's built-in runtime secret mechanism.

Let's unpack the difference.