Or; not storing your password in plaintext, because duh.

This one got me by surprise; if you log in to something like Docker Hub or so using Docker, by default it stores your password in plaintext. Yikes? Fortunately there's a solution, but it still surprises me that you have to manually set this up.

The rest of this quicky assumes you're running macOS and have Brew installed. For different OS'es, please refer to this repo to find an appropriate alternative to use.

I like to keep whatever packages I have installed up-to-date, so let's first update everything we have already installed:

brew update && brew upgrade && brew cleanup

Now, let's install the docker credential helper:

brew install docker-credential-helper

If you previously logged in using Docker, first run docker logout to remove these plaintext-stored credentials. Then, open ~/.docker/config.json with your favorite text editor and add the credsStore option so that it will kind of look like this:

   "credsStore": "osxkeychain",
   "auths": {},
   // ...anything else that was already in this file

That's it! Now you can log in using docker login and your credentials will no longer be stored in plaintext. Huzzah.