docker service update image could not be accessed on a registry to record it's digest
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
The error "image could not be accessed on a registry to record its digest" occurs when docker service update cannot reach the container registry to verify and record the image digest. Docker Swarm resolves image tags to their SHA256 digest during service updates to ensure all nodes pull the exact same image. If the swarm manager cannot contact the registry — due to authentication issues, network problems, or the image not existing — this error is thrown. The fix depends on whether the issue is credentials, network, or the image reference itself.
The Error
Docker Swarm tries to resolve the tag to a digest (e.g., sha256:abc123...) so every node pulls the same bytes. When it cannot reach the registry, it falls back to using the tag — but different nodes might get different images if the tag was updated between pulls.
Fix 1: Log In to the Registry
The swarm manager needs registry credentials to resolve the digest. docker login stores credentials that Docker Swarm uses for digest resolution and image pulls.
Fix 2: Use --with-registry-auth
--with-registry-auth forwards the manager's registry credentials to worker nodes. Without it, worker nodes may not be able to pull the image from a private registry.
Fix 3: Use the Full Digest Instead of Tag
Using the full digest bypasses the tag-to-digest resolution step. Docker does not need to contact the registry to verify the digest — it already knows the exact image to pull.
Fix 4: Use --resolve-image never
--resolve-image never tells Docker Swarm to skip the registry lookup and use the tag as-is. This silences the error but means different nodes might pull different images if the tag is updated between pulls. Use with caution in production.
Fix 5: Network and DNS Issues
If the manager node is behind a firewall or proxy, Docker may not reach the registry. Configure proxy settings in the Docker daemon or ensure the registry is accessible from the manager network.
Fix 6: Self-Signed Certificate Registry
If your private registry uses a self-signed certificate, Docker rejects the TLS connection by default. Add the CA certificate to Docker's trusted store or configure the registry as insecure for development.
Diagnosing the Issue
Common Pitfalls
- Forgetting --with-registry-auth: The swarm manager may have credentials, but worker nodes do not automatically receive them. Without
--with-registry-auth, workers cannot pull from private registries even if the manager can. - Expired ECR/GCR tokens: AWS ECR tokens expire after 12 hours and GCR tokens can expire too. Automate re-authentication in CI/CD pipelines or use credential helpers (
docker-credential-ecr-login) that refresh automatically. - Using latest tag: The
latesttag is mutable — it points to different images over time. Combined with the digest resolution error, different nodes may run different versions. Always use specific version tags or digests. - Registry behind VPN not accessible from all nodes: If the registry is on a private network, ensure all swarm nodes (manager and workers) can reach it. The manager resolves the digest, but workers need to pull the image independently.
- Docker daemon proxy not configured: Even if shell environment variables (
HTTP_PROXY) are set, the Docker daemon runs as a separate systemd service and needs proxy configuration in/etc/systemd/system/docker.service.d/. Shell variables do not propagate to the daemon.
Summary
- The error occurs when Docker Swarm cannot reach the registry to resolve an image tag to a digest
- Log in with
docker loginon the manager node and use--with-registry-authto forward credentials to workers - Use full image digests (
@sha256:...) to skip tag resolution entirely - Use
--resolve-image neveras a last resort to bypass digest resolution - Check network connectivity, DNS, proxy settings, and TLS certificates on all swarm nodes
- Automate credential refresh for registries with expiring tokens (ECR, GCR)

