Docker Community Forums

Share and learn in the Docker community.

Docker push command is throwing error: '405 Method Not Allowed'

dockerhub
amazonwebservices

(Sudhakarbathina) #1

Hi,
I have created a public repository sudhakarbathina/product-basic on docker hub

I am trying to push an image that I created on Rhel EC2 instance. It’s throwing below error.:

error parsing HTTP 405 response body: invalid character ‘<’ looking for beginning of value: “\n405 Method Not Allowed\n

Method Not Allowed

\n

The method POST is not allowed for the requested URL.

\n”

[ec2-user@ip-172-21-31-231 ~]$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don’t have a Docker ID, head over to https://hub.docker.com to create one.
Username: sudhakarbathina
Password:
Login Succeeded
[ec2-user@ip-… ~]$ sudo docker push sudhakarbathina/product-basic
The push refers to a repository [registry.access.redhat.com/sudhakarbathina/product-basic]
4188b2c102db: Preparing
4bc79e8e3d03: Preparing
2829b1fe8676: Preparing
9e4a776bfca4: Preparing
9f5e0b558c16: Preparing
60ab55d3379d: Waiting
error parsing HTTP 405 response body: invalid character ‘<’ looking for beginning of value: “\n405 Method Not Allowed\n

Method Not Allowed

\n

The method POST is not allowed for the requested URL.

\n”

Any help to fix the issue is greatly appreciated. I am using below docker version:

[ec2-user@ip-172-21-31-231 ~]$ docker version
Client:
Version: 1.12.5
API version: 1.24
Package version: docker-common-1.12.5-14.el7.x86_64
Go version: go1.7.4
Git commit: 047e51b/1.12.5
Built: Wed Jan 11 17:53:20 2017
OS/Arch: linux/amd64

Server:
Version: 1.12.5
API version: 1.24
Package version: docker-common-1.12.5-14.el7.x86_64
Go version: go1.7.4
Git commit: 047e51b/1.12.5
Built: Wed Jan 11 17:53:20 2017
OS/Arch: linux/amd64


(Hamster715) #2

Same problem~any one knows how to fix it? Thanks!:sweat:


(Nick van 't Hart) #3

Same problem here, how to fix this?


(Projectionsresearch) #4

This is a pain: I get this error on RHEL7 but not on MAC. Latest versions!


(Dimplerohara) #5

Anyone was able to resolve this issue?


(Luke P.) #6

@dimplerohara Have a glance here. https://bugzilla.redhat.com/show_bug.cgi?id=1434897#c26


(Ssaapt) #7

please let me know if any one got the answer for this problem . or answer here (https://stackoverflow.com/questions/52074994/docker-push-failed-in-red-hat-server-with-error-parsing-http-405-response-body) i will vote if its work .


(M4mukesh) #8

Thanks your info helped.


(Aa047267) #9

@sudhakarbathina I was facing the same issue, I was trying to push the image to Docker Registry from an EC2 Instance but by default it was taking redhat registry instead of hub.docker registry, to resolve this issue I took the below steps:

  1. Go to /etc/containers/registries.conf
  2. Add/Replace ‘registry.hub.docker.com’ for [registries.search] and [registries.insecure] section.
  3. Restart your VM.
  4. Execute docker login -u -p
  5. Execute the push command and it should work.

(Ujnzxw) #10

Really appreciate your method!