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

Replication in MongoDB: Simultaneity of the Non-Simultaneous

JUnit — unit testing framework

OT in Conventional Oil and Gas — Work Flows, Data, Customization, Configuration, and Integration

Game Programming Pattern: Singleton

Why Entity Framework isn’t a Good Model, Part I: Lazy Loading

M4tr1x:Exit Denied TRYACKME Walkthrough

Why Occlusion Culling Improves Performance

Intro tools to start thinking accessible web development

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

Error 1038: Mysql Memory Allocation Error

Setting a Dynamic Date filter in QuickSight (AWS)

Postgres replica conflicts: Part 1

Neutrogena Deep Clean Facial Cleanser — Full Review with Specification