Skip to content

Command Line Tools

wheels docker login

Login to a container registry.

Terminal window
wheels docker login [options]

The wheels docker login command authenticates your Docker client with a container registry. It supports various registry types including Docker Hub, AWS ECR, Google GCR, Azure ACR, and GitHub GHCR.

Interactive Features:

  • Username Recovery: If you omit the --username argument, the command will proactively prompt you for it.
  • Secure Input: Passwords and tokens are masked during entry.
  • Ordered Prompts: For private and ACR registries, the command first asks for the Registry URL to ensure proper host resolution.
OptionDescriptionDefault
--registryRegistry type: dockerhub, ecr, gcr, acr, ghcr, privatedockerhub
--usernameRegistry username (required for dockerhub, ghcr, private)""
--passwordRegistry password or token (optional, will prompt if empty)""
--imageImage name (optional, but required for ECR/ACR to determine region/registry)""
--localExecute login locallytrue

The default registry. Requires your Docker Hub username and password/token.

Terminal window
# Prompts for password
wheels docker login --registry=dockerhub --username=myuser
# With password provided (use with caution in scripts)
wheels docker login --registry=dockerhub --username=myuser --password=mytoken

Authenticates with AWS ECR. Requires the full image repository URI to determine the region and registry ID.

Terminal window
wheels docker login --registry=ecr --image=123456789.dkr.ecr.us-east-1.amazonaws.com/myapp:latest

Authenticates with GitHub’s container registry. Use your GitHub username and a Personal Access Token (PAT) with read:packages scope.

Terminal window
wheels docker login --registry=ghcr --username=mygithubuser

Authenticates with GCR. Requires the image path to determine the registry host (e.g., gcr.io, us.gcr.io).

Terminal window
wheels docker login --registry=gcr --image=gcr.io/my-project/my-app

Authenticates with Azure ACR. Requires the login server address.

Terminal window
wheels docker login --registry=acr --image=myregistry.azurecr.io/my-app

For self-hosted or other private registries. If you don’t provide an image or URL via arguments, you will be prompted in this order: Registry URL -> Username -> Password.

Terminal window
wheels docker login --registry=private

Successful logins save the registry configuration to docker-config.json in your project root. This configuration is used by wheels docker push to automatically authenticate during push operations.

Example docker-config.json:

{
"registry": "ecr",
"image": "123456789.dkr.ecr.us-east-1.amazonaws.com/myapp:latest",
"username": "AWS",
"namespace": "myorg"
}

Security Note: Passwords are not stored in docker-config.json. Only registry type, username, and image references are saved. You may be prompted for a password again during push operations if your session expires.