docker unauthorized: authentication required - upon push with successful login

前端 未结 24 3780
隐瞒了意图╮
隐瞒了意图╮ 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:09

    Same problem here, during pushing image:

    unauthorized: authentication required
    

    What I did:

    docker login --username=yourhubusername --email=youremail@company.com
    

    Which it printed:

    --email is deprecated (but login succeeded still)

    Solution: use the latest login syntax.

    docker login
    

    It will ask for both username and password interactively. Then the image push just works.

    Even after using the new syntax, my ~/.docker/config.json looks like this after logged in:

    {
        "auths": {
            "https://index.docker.io/v1/": {}
        },
        "credsStore": "osxkeychain"
    }
    

    So the credential is in macOS' keychain.

提交回复
热议问题