docker unauthorized: authentication required - upon push with successful login

0 votes

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

Details below.

-bash-4.2# docker login --username=asamba --email=anand.sambamoorthy@gmail.com

WARNING: login credentials saved in /root/.docker/config.json

*Login Succeeded*

-bash-4.2#

-bash-4.2# docker push asamba/docker-whale

Do you really want to push to public registry? [y/n]: y

The push refers to a repository [docker.io/asamba/docker-whale] (len: 0)

faa2fa357a0e: Preparing

unauthorized: authentication required

  • Docker version: 1.9.1 (both client and server)

  • http://hub.docker.com has the repo created as well (asamba/docker-whale).

The /var/log/messages shows 403, I dont know if this docker. See below.

Apr 16 11:39:03 localhost journal: time="2016-04-16T11:39:03.884872524Z" level=info msg="{Action=push, Username=asamba, LoginUID=1001, PID=2125}"

Apr 16 11:39:03 localhost journal: time="2016-04-16T11:39:03.884988574Z" level=error msg="Handler for POST /v1.21/images/asamba/docker-whale/push returned error: Error: Status 403 trying to push repository asamba/docker-whale to official registry: needs to be forced"

Apr 16 11:39:03 localhost journal: time="2016-04-16T11:39:03.885013241Z" level=error msg="HTTP Error" err="Error: Status 403 trying to push repository asamba/docker-whale to official registry: needs to be forced" statusCode=403

Apr 16 11:39:05 localhost journal: time="2016-04-16T11:39:05.420188969Z" level=info msg="{Action=push, Username=asamba, LoginUID=1001, PID=2125}"

Apr 16 11:39:06 localhost kernel: XFS (dm-4): Mounting V4 Filesystem

Apr 16 11:39:06 localhost kernel: XFS (dm-4): Ending clean mount

Apr 16 11:39:07 localhost kernel: XFS (dm-4): Unmounting Filesystem

Jul 31, 2018 in Docker by Hannah
• 16,300 points
1,039 views

1 answer to this question.

0 votes

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

For docker version 17 use

docker login -u username -p password
answered Jul 31, 2018 by Kalgi
• 42,330 points

Related Questions In Docker

0 votes
1 answer

build an J2EE application with docker

I would suggest you to use volume ...READ MORE

answered May 1, 2018 in Docker by shubham
• 6,890 points
51 views
0 votes
1 answer

Docker ports are working on the localhost but not with public ip

Probably, the reason is that you've included ...READ MORE

answered Jun 12, 2018 in Docker by Damon Salvatore
• 5,510 points

edited Oct 15, 2018 by Kalgi 301 views
0 votes
1 answer

Isolate PHP applications with Docker

Here is what you can try. You ...READ MORE

answered Jul 6, 2018 in Docker by Atul
• 10,240 points
66 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,920 points
224 views
0 votes
1 answer

How can I expose more than 1 port with Docker?

To expose just one port, this is ...READ MORE

answered Jul 25, 2018 in Docker by Kalgi
• 42,330 points
38 views
+1 vote
1 answer

How to push a docker image to a private repository

You need to tag your image correctly ...READ MORE

answered Jul 26, 2018 in Docker by Kalgi
• 42,330 points
104 views