14th May 2021
New: Explain how to log in using pass.
pass show dockerhub | docker login --username foo --password-stdin
New: Explain how not to store the credentials in plaintext.
It doesn't work, don't go this painful road and assume that docker is broken.
The official steps are horrible, and once you've spent two hours debugging them, you won't be able to push or pull images with your user.