Docker push not working in 1.8.1 - Not logged in

Hi,

I’m trying to follow the getting started guide, but failing at pushing a copy up to my hub account. It says I’m not authorised, but is also not asking for any creds as part of the push.

Any suggestions ?

Thanks

bash-3.2$ docker pull paulcull/docker-whale
Using default tag: latest
Pulling repository docker.io/paulcull/docker-whale
Tag latest not found in repository docker.io/paulcull/docker-whale
bash-3.2$ docker push paulcull/docker-whale
The push refers to a repository [docker.io/paulcull/docker-whale] (len: 1)
4dd39572da2b: Buffering to Disk 
unauthorized: access to the requested resource is not authorized
bash-3.2$ docker --version
Docker version 1.8.1, build d12ea79
bash-3.2$

Hi Paul,

Before you run the push/pull try doing a ‘docker login’ in the terminal, then run the command.

Thanks.

4 Likes

That solved it - thanks

Whoaa - surprised this isn’t in the getting started guides and had to find my answer here.

I have the same problem but I have not yet resolved:

sudo docker login
Username (mauriziobioinfo):
WARNING: login credentials saved in /home/maurizio/.docker/config.json
Login Succeeded

sudo docker push mauriziobioinfo/varscan
The push refers to a repository [docker.io/mauriziobioinfo/varscan] (len: 1)
ec3a068ba18d: Buffering to Disk
unauthorized: access to the requested resource is not authorized

Same problem with 1.9. Docker login does not solve it.

1.9 and the same =/

Is there some pass by?

I just committed again and ok.

Hi danielbcjr.
How to solve it, I have the same problem the version of docker is 1.9.0b.

Same problem. Logged in successfully, cannot push to my private repository.
Client and server version 1.9.1, API version 1.21

*Edit: My problem was that the repository I had created on the hub and the image I had on my local machine had different names. Renamed my local image to the name I defined on hub and then it worked.

I had the same problem. I noticed when I looked at my images via docker image, my image was patrick/my-nodejs-webserver. The problem was my docker hub account was pnorthcutt. I had to tag my image via docker tag 97cf84649d5a pnorthcutt/my-nodejs-webserver. Now I had an image with the correct username.

1.9.1 and same problem

I can login but I still have the message :

unauthorized: access to the requested resource is not authorized

I had the same problem. I could login to my private repository but while pushing some image I’ve got an unauthorized error.
The content of my ~/.docker/config.json was

{
	"auths": {
		"private.registry.url.com": {
			"auth": "someAuthString",
			"email": "x@foo.bar"
		},
		"https://index.docker.io/v1/": {
			"auth": "someAuthString",
			"email": "y@bar.foo"
		}
	}
}

So probably while pushing to private repo docker used wrong authentication entity. Because after I removed this file and
did docker login again the problem was fixed.
Hope it will help someone

1 Like

logging in worked for me, I’d probably double check ~/.docker/config.json if it isn’t working for you.

In fact, it could be related to an issue in your config file.

Open your config.json, if they looks like this:

`

{
"auths": {
    "docker.io": {
        "auth": "your_encoded_password",
        "email": "your_email_address"
    }
}

Change the endpoint of the login operations:

{
"auths": {
    "https://index.docker.io/v1/": {
        "auth": "your_encoded_password",
        "email": "your_email_address"
    }
}

Client:
Version: 1.9.1-fc23
API version: 1.21
Package version: docker-1.9.1-4.git6ec29ef.fc23.x86_64
Go version: go1.5.1
Git commit: 110aed2-dirty
Built: Wed Dec 9 09:09:16 UTC 2015
OS/Arch: linux/amd64

Server:
Version: 1.9.1-fc23
API version: 1.21
Package version: docker-1.9.1-4.git6ec29ef.fc23.x86_64
Go version: go1.5.1
Git commit: 110aed2-dirty
Built: Wed Dec 9 09:09:16 UTC 2015
OS/Arch: linux/amd64

Same problem. In fact, it could be related to an issue in your config file.

Open your config.json, if they looks like this:

{
“auths”: {
docker.io”: {
“auth”: “your_encoded_password”,
“email”: “your_email_address”
}
}

Change the endpoint of the login operations:

{
“auths”: {
https://index.docker.io/v1/”: {
“auth”: “your_encoded_password”,
“email”: “your_email_address”
}
}

i hope it will help some one.

1 Like

I’ve had this issue if I had the (say) 20 repo plan and I was trying to push my 21st.

Thanks. Updating the route to (https://index.docker.io/v1/) in ~/.docker/config.json fixed the issue. For some reason simply having “docker.io” no longer is enough.

That did it, thanks!

this is how my Config file looks… I cant see anything simkialr to what people have suggested above to change/check the config.json file

{
“ConfigVersion”: 3,
“Driver”: {
“IPAddress”: “192.168.99.100”,
“MachineName”: “default”,
“SSHUser”: “docker”,
“SSHPort”: 64830,
“SSHKeyPath”: “D:\Users\Administrator\.docker\machine\machines\default\id_rsa”,
“StorePath”: “D:\Users\Administrator\.docker\machine”,
“SwarmMaster”: false,
“SwarmHost”: “tcp://0.0.0.0:3376”,
“SwarmDiscovery”: “”,
“VBoxManager”: {},
“HostInterfaces”: {},
“CPU”: 1,
“Memory”: 1024,
“DiskSize”: 20000,
“NatNicType”: “82540EM”,
“Boot2DockerURL”: “”,
“Boot2DockerImportVM”: “”,
“HostDNSResolver”: false,
“HostOnlyCIDR”: “192.168.99.1/24”,
“HostOnlyNicType”: “82540EM”,
“HostOnlyPromiscMode”: “deny”,
“UIType”: “headless”,
“HostOnlyNoDHCP”: false,
“NoShare”: false,
“DNSProxy”: true,
“NoVTXCheck”: false,
“ShareFolder”: “”
},
“DriverName”: “virtualbox”,
“HostOptions”: {
“Driver”: “”,
“Memory”: 0,
“Disk”: 0,
“EngineOptions”: {
“ArbitraryFlags”: [],
“Dns”: null,
“GraphDir”: “”,
“Env”: [],
“Ipv6”: false,
“InsecureRegistry”: [],
“Labels”: [],
“LogLevel”: “”,
“StorageDriver”: “”,
“SelinuxEnabled”: false,
“TlsVerify”: true,
“RegistryMirror”: [],
“InstallURL”: “https://get.docker.com
},
“SwarmOptions”: {
“IsSwarm”: false,
“Address”: “”,
“Discovery”: “”,
“Agent”: false,
“Master”: false,
“Host”: “tcp://0.0.0.0:3376”,
“Image”: “swarm:latest”,
“Strategy”: “spread”,
“Heartbeat”: 0,
“Overcommit”: 0,
“ArbitraryFlags”: [],
“ArbitraryJoinFlags”: [],
“Env”: null,
“IsExperimental”: false
},
“AuthOptions”: {
“CertDir”: “D:\Users\Administrator\.docker\machine\certs”,
“CaCertPath”: “D:\Users\Administrator\.docker\machine\certs\ca.pem”,
“CaPrivateKeyPath”: “D:\Users\Administrator\.docker\machine\certs\ca-key.pem”,
“CaCertRemotePath”: “”,
“ServerCertPath”: “D:\Users\Administrator\.docker\machine\machines\default\server.pem”,
“ServerKeyPath”: “D:\Users\Administrator\.docker\machine\machines\default\server-key.pem”,
“ClientKeyPath”: “D:\Users\Administrator\.docker\machine\certs\key.pem”,
“ServerCertRemotePath”: “”,
“ServerKeyRemotePath”: “”,
“ClientCertPath”: “D:\Users\Administrator\.docker\machine\certs\cert.pem”,
“ServerCertSANs”: [],
“StorePath”: “D:\Users\Administrator\.docker\machine\machines\default”
}
},
“Name”: “default”
}