docker unauthorized: authentication required - upon push with successful login

前端 未结 24 3193
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 06:21

While pushing the docker image (after successful login) from my host I am getting \"unauthorized: authentication required\".

Details below.

-bash-4.         


        
相关标签:
24条回答
  • 2020-11-28 07:03

    Edit(13/08/2017)

    Based on @KaraPirinc's comment, in docker version 17 in order to log in (Step 1),

    docker login -u username -p password
    

    I also had the same issue.This is how I resolve it.

    Step 1: log in to docker hub

    docker login --username=<user username> --email=<user email address>
    

    Step2: create a repository in the docker hub. let's say "mysqlserver:sql".

    docker push <user username>/mysqlserver:sql
    
    0 讨论(0)
  • 2020-11-28 07:05

    My problem was an invalid Authorization token after 5 minutes. The push took more than 5 minutes because of the image size.

    I've fixed it by increasing the "Authorization token duration" to 10 minutes.

    0 讨论(0)
  • 2020-11-28 07:06

    I have received similar error for sudo docker push /sudo docker pull on ecr repository.This is because aws cli installed in my user(abc) and docker installed in root user.I have tried to run sudo docker push on my user(abc)

    Fixed this by installed aws cli in root , configured aws using aws configure in root and run sudo docker push to ecr on root user

    0 讨论(0)
  • 2020-11-28 07:06

    Try docker logout first, then relogin with docker login

    0 讨论(0)
  • 2020-11-28 07:07

    You can mv the xxx/.docker/config.json file somewhere for handle it. Then try to login again for create new config.json file.

    #mv xx/.docker/config.json xx/.docker/config_old.json
    #docker login https://index.docker.io/v1/
    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: YOUR USERNAME
    Password: YOUR PASSWORD
    WARNING! Your password will be stored unencrypted in /xxx/.docker/config.json.
    Configure a credential helper to remove this warning. See https://docs.docker.com/engine/reference/commandline/login/#credentials-store
    
    Login Succeeded
    
    0 讨论(0)
  • 2020-11-28 07:09

    Make sure you have more slots for private images.

    In my case I converted a user into an organization and it lost it's one free private image, so previous pushes that worked, no longer worked.

    0 讨论(0)
提交回复
热议问题