Docker Hub tokens separate integration credentials from account passwords
Docker Hub now accepts personal access tokens through docker login. Independent revocation improves integration management, while the CLI's credential-storage rules still apply.
A shared account password creates a shared replacement problem when several tools use it. Docker Hub's September 19 introduction of personal access tokens gives each integration a credential that can be revoked independently. The Hub release notes place token creation in the account's Security settings and identify Docker CLI authentication as the immediate use.
The launch announcement explains the operational unit of the change. An account can create multiple tokens, assign different ones to different integrations, and delete an individual token. The CLI accepts the token where it previously accepted the password. This supplies a more manageable credential lifecycle without asking every integration to adopt a new command interface.
I value Docker's ability to move the same image between machines. A registry credential participates in that movement, but its lifecycle should not have to match the lifetime of a personal account password. Independent revocation is the part of this launch that matters most to me.
The login interface stays familiar
The announcement's interactive example uses the normal username flag. When Docker prompts for a password, the user enters the token instead. No separate token-specific login command is needed.
docker login --username YOUR_DOCKER_ID
This example intentionally leaves the secret out of the command line. The command identifies the account, while the prompt receives the credential. The token is still a secret granting authentication, so changing its name from password to token does not remove the need to control where it is copied.
Docker displays the token only once at creation, according to the launch announcement. If it is lost, the documented response is to delete it and create another. That means the browser's token-management list and the actual credential value have different purposes. The list supports lifecycle management, while the displayed value must reach the intended credential store or integration when it is created.
Independent revocation changes failure handling. If one integration's credential needs replacing, its token can be deleted without replacing every other integration's token. This is the direct benefit described at launch. It does not require assuming that a token automatically has narrower repository permissions than the account password it substitutes for.
Noninteractive login already has a secret-input channel
The Docker CLI login documentation at version 19.03.1 documents --password-stdin. It exists to let noninteractive login receive the secret through standard input, keeping the value out of shell history and command-line logging paths. That interface can receive the token used in place of a password.
This is a useful distinction between supplying a credential and storing it. Standard input controls how the login command receives the secret. It does not by itself determine what happens after a successful login. The same documentation separately describes where Docker retains credentials and how external helpers participate.
For an automated integration, those are two separate design decisions. The job needs a way to receive its own token, and the client needs a suitable place to retain the resulting login credential if later operations reuse it. Creating a dedicated token does not settle either local handling question automatically.
The source also documents a password option that accepts a value directly. Its presence does not make it the best example for a token-bearing script. The standard-input path exists for the specific reason that credential values should not become command text. A token issued for automation benefits from that existing input mechanism.
A token still follows the credential-helper configuration
The contemporary CLI guide explains that an external credential store can hold credentials through a helper program. Docker requires that helper on the client's executable search path. The configuration selects the helper using the suffix after docker-credential-.
For the macOS keychain helper, the documented configuration is compact.
{
"credsStore": "osxkeychain"
}
This configures storage behavior. It does not create a Hub token or change the token's remote validity. The separation matters when removing access, because deleting a local credential and revoking a credential at the registry are different operations. One changes what the client retains, while the other changes what Hub will accept.
The guide says Docker looks for native helpers by platform, including the macOS keychain helper and Windows Credential Manager helper. On Linux it looks for pass and can fall back to Secret Service. Where no suitable helper exists, the documented fallback stores credentials in base64 form in the Docker configuration file.
That fallback is relevant to automation because a minimal environment may not have the helper available on a developer workstation. A successful login alone does not establish that an operating-system keychain received the token. The configured store and installed helper determine the actual path.
The helper protocol includes storing, retrieving and erasing credentials. It associates them with a server address and a username. The guide also documents registry-specific credHelpers configuration, which overrides the default store for the named registries. The registry-specific helper takes precedence for its configured domain, so changing the default store need not change that registry. A client can therefore retain distinct handling for different registry services without changing the Docker Hub token itself.
Revocation needs an identifiable integration
The benefit of multiple tokens depends on retaining the relationship between each token and its consumer. An integration-specific credential lets the account owner remove one consumer's access deliberately. Reusing one newly created token everywhere would preserve much of the replacement coupling that the feature is intended to remove.
My preference is to keep the image artifact independent of this credential lifecycle. The image is what moves between build and runtime environments. The credential authorizes registry operations performed by the surrounding tools, so it belongs to their authentication configuration rather than to the application contents.
The launch provides an immediate lifecycle improvement with a familiar login flow. A dedicated integration can receive its own token, the CLI can retain it through its existing storage mechanism, and Hub can revoke it independently. Those are separate operations whose relationship is now easier to express without circulating the account password.