Skip to main content
RunBook Academy

← All labs in Docker & Containers

Lab · intermediate · ~20 min

Lab 23: Registry authentication failure

B · Nested virtualisationC · Simulation

Objectives

  • Recognise auth-failure error messages
  • Inspect and fix the credential configuration

Prerequisites

  • Docker installed; access to a private registry

Objective

Reproduce a registry auth failure and fix it.

Tasks

Task 1: Attempt to pull from a private registry without auth

docker pull registry.example.com/myorg/app:1.0.0
# Error response from daemon: Head ... no basic auth credentials

Task 2: Log in

docker login registry.example.com
# Username: myorg
# Password: ********
docker pull registry.example.com/myorg/app:1.0.0

Task 3: Verify credentials are stored

cat ~/.docker/config.json | jq '.auths'
# The registry is listed with an encrypted credential.

Task 4: Diagnose an expired token

Rotate the password in the registry, then attempt to pull again:

docker pull registry.example.com/myorg/app:1.0.0
# unauthorized: authentication required

docker login registry.example.com fixes it.

Task 5: Use a credential helper

For CI / automation, avoid interactive login:

# Create a credential helper
docker-credential-secretservice list
# or
echo 'registry.example.com' | docker-credential-ecr-login get

Configure in ~/.docker/config.json:

{
  "credHelpers": {
    "registry.example.com": "ecr-login"
  }
}

Verification status

Last reviewed
2026-08-09
Executed end to end
not yet run on hardware

The commands and configuration here have been reviewed against the verified software versions, but nobody has run this lab start to finish on a system meeting its prerequisites. Treat the Expected Outcome as the intended result rather than an observed one, and keep the Cleanup section to hand.