Skip to content

DockerToolbox in windows Login/push doesnt works properly (With a workaround) #473

@ghost

Description

Hi all,

My Use case is the following:
I have a DockerHub account and I want to push an image to my repository.

So, the order to do this (having the image ready locally with the same name that my user/repo):

  1. Login using docker login
  2. Docker push

The First Error is when I tried to login automatically:

$ docker login --username=myuser --password=mypasswd --email=myemail
Error response from daemon: Unexpected status code [403] : <html><body><h1>403 Forbidden</h1>
Request forbidden by administrative rules.
</body></html>

Looking with a network monitor is trying to connect to https://registry-win-tp3.docker.io/v2/ and its getting this error.

If I specify the default index registry of docker io, the login is OK and creates the ~/.docker/config.json file propery with the following content

docker login --username=myuser --password=mypassword --email=myemail https://index.docker.io/v1/
WARNING: login credentials saved in C:\Users\myuser\.docker\config.json
Login Succeeded

The file content is the following:

{
    "auths": {
        "https://index.docker.io/v1/": {
            "auth": "MYHASH",
            "email": "myemail"
        }
    }
}

Ok, first sorted.
But everytime that I tried to push an image to my repos:

$ docker push index.docker.io/myuser/myrepo:latest
The push refers to a repository [docker.io/myuser/myrepo] (len: 1)
e9917e246cb6: Preparing
unauthorized: access to the requested resource is not authorized

After a bit of research, I had the suspicious that he is not using my Login credentials because he is trying to connect against the win registry so, i modified my config.json adding the same credentials for index.docker.io for the registry-win.. like this:

{
    "auths": {
        "https://index.docker.io/v1/": {
            "auth": "myhash",
            "email": "myemail"
        },
        "https://registry-win-tp3.docker.io/v1/": {
            "auth": "myhash",
            "email": "mydomain"         
        }
    }
}

And doing this, everything start to working properly.

Hope it helps

My Docker Installation Details are:
Operating System: Windows 10

$ docker info

Containers: 2
Images: 115
Server Version: 1.9.0
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 119
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.1.12-boot2docker
Operating System: Boot2Docker 1.9.0 (TCL 6.4); master : 16e4a2a - Tue Nov  3 19:49:22 UTC 2015
CPUs: 1
Total Memory: 7.696 GiB
Name: default
ID: IDUNNOIFTHISISIMPORTANT
Debug mode (server): true
 File Descriptors: 24
 Goroutines: 88
 System Time: 2015-11-18T16:13:52.691740338Z
 EventsListeners: 1
 Init SHA1:
 Init Path: /usr/local/bin/docker
 Docker Root Dir: /mnt/sda1/var/lib/docker
Username: myuser
Registry: https://index.docker.io/v1/
Labels:
 provider=virtualbox

$ docker version

Client:
 Version:      1.9.0
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   76d6bc9
 Built:        Tue Nov  3 19:20:09 UTC 2015
 OS/Arch:      windows/amd64

Server:
 Version:      1.9.0
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   76d6bc9
 Built:        Tue Nov  3 19:20:09 UTC 2015
 OS/Arch:      linux/amd64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions