Trying to run docker-compose up or a docker container through the CLI but getting a mysterious error: unauthorized: incorrect username or password? Yea me too, it was highly annoying but I was able to fix it.

Symptoms

  • Unable to pull images in the docker CLI tool
  • Unable to login into docker hub via the CLI command docker login

Solution

The problem is that the Docker Mac GUI will allow you to login to your DockerHub account with your email address. However the Docker CLI only accepts Docker ID’s as valid credentials.

  1. Log out of the Docker GUI on Mac by clicking the toolbar icon and selecting “your Docker username here : sign out”
  2. Sign back into Docker GUI with your Docker ID. Your Docker ID is your Docker username, not your email address.
  3. After signing back in, run docker login. The Docker CLI will automatically use the Docker GUI credentials.

Follow up

Check out the ever growing Github Issue on this topic for more information.