Unable to push image to docker hub

I have built a docker image and have committed the changes, and am attempting to push the image to my public docker hub account.

When attempting to push the image to the docker hub registry it seems to try utilise my hub username as a private server address.

What i have done done so far is run a fedora base image, make my changes and then commit the changed using docker commit dd09de55abc9 username/fedora-23-httpd

When i do this and check the image using docker images i get the output:

# docker images
REPOSITORY                              TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
/username/fedora-23-httpd             latest              0b9b4d0b820e        21 seconds ago      468.5 MB

Then when running docker push username/fedora-23-httpd i get the message:

The push refers to a repository [username/fedora-23-httpd] (len: 1)
unable to ping registry endpoint https://username/v0/
v2 ping attempt failed with error: Get https://username/v2/: dial tcp: lookup username: No address associated with hostname
 v1 ping attempt failed with error: Get https://username/v1/_ping: dial tcp: lookup username: No address associated with hostname

From other tutorials I have read my commands appear to be correct, but the output of the images command shows the repository name with a / at the start.

I’ve also tried the command docker commit dd09de55abc9 docker.io/username/fedora-23-httpd which seems to correct the proceeding / in the images list, but still generates the same message when attempting to push the image to docker hub.

Can anyone advise what i may be doing wrong here?

Hello:

   I think 2 things you need to confirm.

   1.Ensure you use "docker login" to get authentication.
   2.Ensure you've created a repository named "username/fedora-23-httpd"(same with your images tag)  in docker hub website.

  Hope this will be useful for you.

Hey @ericcheung

I can can confirm I have used the docker login command and have the correct repository created.

Problem is it is attempting to connect to a non existent server https://username/ - so doesn’t even get the chance to authenticate to the docker hub.

Hello,please help to send me your docker daemon configuration.
You can use **ps -ef **on the host server.
Thank you.

Hi

ps -ef output:

UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Dec09 ? 00:00:04 /usr/lib/systemd/systemd --system --deserialize 15
root 2 0 0 Dec09 ? 00:00:00 [kthreadd]
root 3 2 0 Dec09 ? 00:00:08 [ksoftirqd/0]
root 7 2 0 Dec09 ? 00:00:34 [rcu_sched]
root 8 2 0 Dec09 ? 00:00:00 [rcu_bh]
root 9 2 0 Dec09 ? 00:00:16 [rcuos/0]
root 10 2 0 Dec09 ? 00:00:00 [rcuob/0]
root 11 2 0 Dec09 ? 00:00:00 [migration/0]
root 12 2 0 Dec09 ? 00:00:00 [watchdog/0]
root 13 2 0 Dec09 ? 00:00:00 [khelper]
root 14 2 0 Dec09 ? 00:00:00 [kdevtmpfs]
root 15 2 0 Dec09 ? 00:00:00 [netns]
root 16 2 0 Dec09 ? 00:00:00 [perf]
root 17 2 0 Dec09 ? 00:00:00 [writeback]
root 18 2 0 Dec09 ? 00:00:00 [ksmd]
root 19 2 0 Dec09 ? 00:00:00 [khugepaged]
root 20 2 0 Dec09 ? 00:00:00 [crypto]
root 21 2 0 Dec09 ? 00:00:00 [kintegrityd]
root 22 2 0 Dec09 ? 00:00:00 [bioset]
root 23 2 0 Dec09 ? 00:00:00 [kblockd]
root 24 2 0 Dec09 ? 00:00:00 [ata_sff]
root 25 2 0 Dec09 ? 00:00:00 [md]
root 26 2 0 Dec09 ? 00:00:00 [devfreq_wq]
root 29 2 0 Dec09 ? 00:00:00 [kswapd0]
root 30 2 0 Dec09 ? 00:00:00 [fsnotify_mark]
root 73 2 0 Dec09 ? 00:00:00 [kthrotld]
root 74 2 0 Dec09 ? 00:00:00 [acpi_thermal_pm]
root 75 2 0 Dec09 ? 00:00:00 [scsi_eh_0]
root 76 2 0 Dec09 ? 00:00:00 [scsi_tmf_0]
root 77 2 0 Dec09 ? 00:00:00 [scsi_eh_1]
root 78 2 0 Dec09 ? 00:00:00 [scsi_tmf_1]
root 80 2 0 Dec09 ? 00:00:00 [kpsmoused]
root 82 2 0 Dec09 ? 00:00:00 [dm_bufio_cache]
root 83 2 0 Dec09 ? 00:00:00 [ipv6_addrconf]
root 123 2 0 Dec09 ? 00:00:00 [deferwq]
root 166 2 0 Dec09 ? 00:00:00 [kauditd]
root 406 2 0 Dec09 ? 00:00:00 [mpt_poll_0]
root 407 2 0 Dec09 ? 00:00:00 [mpt/0]
root 410 2 0 Dec09 ? 00:00:00 [scsi_eh_2]
root 411 2 0 Dec09 ? 00:00:00 [scsi_tmf_2]
root 416 2 0 Dec09 ? 00:00:00 [ttm_swap]
root 483 2 0 Dec09 ? 00:00:00 [kdmflush]
root 484 2 0 Dec09 ? 00:00:00 [bioset]
root 494 2 0 Dec09 ? 00:00:00 [kdmflush]
root 495 2 0 Dec09 ? 00:00:00 [bioset]
root 520 2 0 Dec09 ? 00:00:00 [xfsalloc]
root 521 2 0 Dec09 ? 00:00:00 [xfs_mru_cache]
root 522 2 0 Dec09 ? 00:00:00 [xfs-buf/dm-0]
root 525 2 0 Dec09 ? 00:00:00 [xfs-data/dm-0]
root 526 2 0 Dec09 ? 00:00:00 [xfs-conv/dm-0]
root 527 2 0 Dec09 ? 00:00:00 [xfs-cil/dm-0]
root 528 2 0 Dec09 ? 00:00:03 [xfsaild/dm-0]
root 614 1 0 Dec09 ? 00:00:01 /usr/lib/systemd/systemd-journald
root 642 2 0 Dec09 ? 00:00:00 [rpciod]
root 725 2 0 Dec09 ? 00:00:00 [jbd2/sda1-8]
root 726 2 0 Dec09 ? 00:00:00 [ext4-rsv-conver]
root 754 1 0 Dec09 ? 00:00:00 /sbin/auditd -n
root 785 2 0 Dec09 ? 00:00:00 [hci0]
root 786 2 0 Dec09 ? 00:00:00 [hci0]
chrony 806 1 0 Dec09 ? 00:00:01 /usr/sbin/chronyd
dbus 825 1 0 Dec09 ? 00:00:01 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root 834 1 0 Dec09 ? 00:00:00 /usr/sbin/smartd -n -q never
polkitd 835 1 0 Dec09 ? 00:00:00 /usr/lib/polkit-1/polkitd --no-debug
root 836 1 0 Dec09 ? 00:00:00 /usr/lib/systemd/systemd-logind
root 839 1 0 Dec09 ? 00:00:00 /usr/sbin/rsyslogd -n
root 841 1 0 Dec09 ? 00:00:00 /usr/bin/python3 -Es /usr/sbin/firewalld --nofork --nopid
root 845 1 0 Dec09 ? 00:00:00 /usr/sbin/mcelog --ignorenodev --daemon --foreground
root 956 1 0 Dec09 ? 00:00:00 /usr/sbin/NetworkManager --no-daemon
root 980 1 0 Dec09 ? 00:00:00 /usr/sbin/atd -f
root 984 1 0 Dec09 tty1 00:00:00 /sbin/agetty --noclear tty1 linux
root 1329 956 0 Dec09 ? 00:00:00 /sbin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-eno16777736.pid -lf /var/lib/NetworkManager/dhclient
root 1377 1 0 Dec09 ? 00:00:00 /usr/lib/systemd/systemd --user
root 1379 1377 0 Dec09 ? 00:00:00 (sd-pam)
root 2481 1 0 Dec09 ? 00:00:00 /usr/sbin/crond -n
root 2546 1 0 Dec09 ? 00:00:00 /usr/lib/systemd/systemd-udevd
root 4151 1 0 Dec09 ? 00:00:00 /usr/sbin/sshd -D
root 4329 1 0 Dec09 ? 00:00:00 /usr/sbin/gssproxy -D
root 4605 1 0 Dec09 ? 00:00:38 /usr/bin/docker daemon --selinux-enabled --log-driver=journald
root 4611 2 0 Dec09 ? 00:00:00 [kloopd0]
root 4613 2 0 Dec09 ? 00:00:00 [kloopd1]
root 4616 2 0 Dec09 ? 00:00:00 [kdmflush]
root 4618 2 0 Dec09 ? 00:00:00 [bioset]
root 4619 2 0 Dec09 ? 00:00:00 [kcopyd]
root 4620 2 0 Dec09 ? 00:00:00 [bioset]
root 4621 2 0 Dec09 ? 00:00:00 [dm-thin]
root 4622 2 0 Dec09 ? 00:00:00 [bioset]
root 4711 1 0 Dec09 ? 00:00:00 /usr/sbin/lvmetad -f
root 4874 1 0 Dec09 ? 00:00:00 /usr/sbin/abrtd -d -s
root 4899 1 0 Dec09 ? 00:00:00 /usr/bin/abrt-dump-journal-oops -fxtD
root 19499 4151 0 Dec09 ? 00:00:00 sshd: root [priv]
root 19503 19499 0 Dec09 ? 00:00:01 sshd: root@pts/0
root 19504 19503 0 Dec09 pts/0 00:00:00 -bash
root 19588 2 0 Dec09 ? 00:00:03 [kworker/u256:0]
root 19602 2 0 Dec09 ? 00:00:00 [kworker/u257:12]
root 19603 2 0 Dec09 ? 00:00:00 [kworker/u257:13]
root 43841 2 0 07:35 ? 00:00:27 [kworker/0:3]
root 43958 2 0 10:37 ? 00:00:01 [kworker/u256:2]
root 44341 2 0 21:02 ? 00:00:00 [kworker/0:0H]
root 44344 2 0 21:10 ? 00:00:00 [kworker/0:2H]
root 44345 2 0 21:13 ? 00:00:00 [kworker/0:1]
root 44346 2 0 21:18 ? 00:00:00 [kworker/0:0]
root 44362 19504 0 21:20 pts/0 00:00:00 ps -ef

also…

docker version
Client:
Version: 1.9.1-fc23
API version: 1.21
Package version: docker-1.9.1-2.git78bc3ea.fc23.x86_64
Go version: go1.5.1
Git commit: f7c1d52-dirty
Built: Fri Nov 20 21:07:14 UTC 2015
OS/Arch: linux/amd64

Server:
Version: 1.9.1-fc23
API version: 1.21
Package version: docker-1.9.1-2.git78bc3ea.fc23.x86_64
Go version: go1.5.1
Git commit: f7c1d52-dirty
Built: Fri Nov 20 21:07:14 UTC 2015
OS/Arch: linux/amd64

thanks

Hello bradshawit:

docker images

REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
/username/fedora-23-httpd latest 0b9b4d0b820e 21 seconds ago 468.5 MB

About the REPOSITORY name ,why there is a / in the front?

Hey.

I’m not sure why there is a / at the front.

When i run the command “docker commit dd09de55abc9 username/fedora-23-httpd” the system puts that there

When i run the command “docker commit dd09de55abc9 docker.io/username/fedora-23-httpd” - it lists it correctly without the proceeding / - but the same issue occurs where it tries to connect to a server with my username rather than the docker hub.

Same problem here (once with a private and once with a public repository:

[root@svgator test]# docker login
Username: reinhapa
Password: 
Email: patrick@reini.net
WARNING: login credentials saved in /root/.docker/config.json
Login Succeeded
[root@svgator test]# docker push reinhapa/test
The push refers to a repository [docker.io/reinhapa/test] (len: 0)
63f1f8b3d4cb: Preparing 
unauthorized: access to the requested resource is not authorized
[root@svgator test]# docker push reinhapa/myimage
The push refers to a repository [docker.io/reinhapa/myimage] (len: 0)
63f1f8b3d4cb: Preparing 
unauthorized: access to the requested resource is not authorized
[root@svgator test]# docker version
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

On my Mac with docker machine login fails:

Patricks-MacBook-Air:test pr$ docker login
Username: reinhapa
Password: 
Email: patrick@reini.net
Error response from daemon: Server Error: Post https://index.docker.io/v1/users/: dial tcp: lookup index.docker.io on 83.144.199.72:53: server misbehaving
Patricks-MacBook-Air:test pr$ 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:      darwin/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

Mine has been solved now. Was due to the version of docker that comes with Fedora - I’ve uninstalled docker and re-installed using the scripts supplied by docker wget -qO- https://get.docker.com/ | sh

Sometimes restarting docker cli fixes this type of issues. service docker restart.

my solution, as Fedora user, was don’t use docker from dnf. seems like it’s f*cked. use curl -fsSL https://get.docker.com/ | sh