Skip to main content
Authenticates with a registry. Credentials can be provided interactively or via flags. The login is stored for reuse by subsequent commands.

Usage

container registry login [--scheme <scheme>] [--password-stdin] [--username <username>] [--debug] <server>

Arguments

server
string
required
Registry server name

Options

--scheme
string
default:"auto"
Scheme to use when connecting to the container registry. One of: http, https, autoBehavior of auto:When auto is selected, the target registry is considered internal/local if the registry host matches any of these criteria:
  • The host is a loopback address (e.g., localhost, 127.*)
  • The host is within the RFC1918 private IP ranges:
    • 10.*.*.*
    • 192.168.*.*
    • 172.16.*.* through 172.31.*.*
  • The host ends with the machine’s default container DNS domain
For internal/local registries, the client uses HTTP. Otherwise, it uses HTTPS.
--password-stdin
boolean
Take the password from stdin
-u, --username
string
Registry user name
--debug
boolean
Enable debug mode

Examples

# login to a registry with interactive prompts
container registry login registry.example.com

# login with username specified
container registry login --username myuser registry.example.com

# login with password from stdin
echo "mypassword" | container registry login --password-stdin --username myuser registry.example.com

# login to a local registry using HTTP
container registry login --scheme http localhost:5000

Build docs developers (and LLMs) love