Personal access tokens (original) (raw)

Personal access tokens (PATs) provide a secure alternative to passwords for Docker CLI authentication. Use PATs to authenticate automated systems, CI/CD pipelines, and development tools without exposing your Docker Hub password.

PATs offer significant security advantages over password authentication:

Use PATs for these common scenarios:

For organization-wide automation, considerorganization access tokens which aren't tied to individual user accounts.

Treat access tokens like passwords and keep them secure. Store tokens in credential managers and never commit them to source code repositories.

To create a personal access token:

  1. Sign in to Docker Home.
  2. Select your avatar in the top-right corner and from the drop-down menu select Account settings.
  3. Select Personal access tokens.
  4. Select Generate new token.
  5. Configure your token:
    • Description: Use a descriptive name that indicates the token's purpose
    • Expiration date: Set an expiration date based on your security policies
    • Access permissions: Read, Write, or Delete.
  6. Select Generate. Copy the token that appears on the screen and save it. You won't be able to retrieve the token once you exit the screen.

Sign in to the Docker CLI using your personal access token:

When prompted for a password, enter your personal access token instead of your Docker Hub password.

You can't edit the expiration date on an existing personal access token. You must create a new PAT if you need to set a new expiration date.

You can rename, activate, deactivate, or delete a token as needed. You can manage your tokens in your account settings.

  1. Sign in to Docker Home.
  2. Select your avatar in the top-right corner and from the drop-down menu select Account settings.
  3. Select Personal access tokens.
    • This page shows an overview of all your tokens, and lists if the token was generated manually or if it wasauto-generated. You can also view the scope of the tokens, which tokens are activate and inactive, when they were created, when they were last used, and their expiration date.
  4. Select the actions menu on the far right of a token row, then select Deactivate or Activate, Edit, or Delete to modify the token.
  5. After editing the token, select Save token.

Docker Desktop automatically creates authentication tokens when you sign in, with these characteristics:

You can manually delete auto-generated tokens if needed, but they'll be recreated when you use Docker Desktop.

When using personal access tokens, be aware that excessive token creation may result in throttling or additional charges. Docker reserves the right to impose restrictions on accounts with excessive PAT usage to ensure fair resource allocation and maintain service quality.

Best practices for fair use include: