How does docker authentication with private registry work ? Lets find out

Photo by Christian Stahl on Unsplash

Username/password

  • Successful Login:
mymachine$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: myaccount123
Password:
WARNING! Your password will be stored unencrypted in /home/mymachine/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
mymachine$ openssl enc --base64 -d <<< bXlhY2NvdW50MTIzOnBhc3N3b3JkCg==
myaccount123:password
  • Failed Login
mymachine$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don’t have a Docker ID, head over to https://hub.docker.com to create one.
Username: myaccount123
Password:
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password

Credential Store/Credential Helpers

"credsStore": "customcredential-store"
  • The docker cli invokes the docker daemon
  • If you are pushing or pulling from a private registry, docker needs to authenticate with the registry and which is what this post is about.
    The docker client passes the auth info to docker daemon in a header named X-Registry-Auth and the daemon uses this to authenticate with the registry.Some references ref1, ref2, here, here
  • How the authentication is setup at the registry itself is mentioned here.

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Making Your Own Spotify Discover Weekly Playlist

What is Functional Testing? — A Complete Guide To Automation Tools

Virtual Machines on Microsoft Azure- A Detailed Guide for Beginners

CS373 Fall 2021: Fourth Blog

Configuring Your Wallet With The Matic Network (Polygon)

Codility Algorithm Practice Lesson 11: Sieve of Eratosthenes, Task 2: CountSemiPrimes— a Python…

Photo filter

Jigsaw — an honest review

Data distribution and storage in Apache Cassandra | Perfomatix | Full Stack Engineering Company

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
none

none

More from Medium

Stream Linux or Windows Logs to AWS Cloud Watch

How to create a Lambda function, Java 8, AWS Lambda, SAM CLI and testing/debuging locally.

Deploying web applications on AWS using Terraform

How to use AWS CodeCommit