将容器推送到bluemix注册表:405方法不允许

时间:2015-09-13 20:34:21

标签: docker ibm-cloud

docker push registry.ng.bluemix.net/container_registry/ [my_image_name] 返回405方法不允许。

这是我的程序:

我查看了如何将容器添加到bluemix的说明: https://console.ng.bluemix.net/catalog/add-your-own/

第一: 我登录时使用:

cf login
cf ic login

bluemix指令没有提到端点。我用谷歌搜索了端点并连接到https://api.ng.bluemix.net 一切正常。 这是输出:

** Retrieving client certificates from IBM Containers
** Storing client certificates in /home/compute/.ice/certs
Successfully retrieved client certificates
** Checking local docker configuration
Not OK
Docker local daemon may not be running. You can still run IBM Containers on the cloud

There are two ways to use the CLI with IBM Containers:

Option 1) This option allows you to use cf ic for managing containers on IBM Containers while still using the docker CLI directly to manage your local docker host. 
Leverage this Cloud Foundry IBM Containers plugin without affecting the local docker environment:


Example Usage:
cf ic ps
cf ic images

Option 2) Leverage the docker CLI directly. In this shell, override local docker environment to connect to IBM Containers by setting these variables, copy and paste the following:
Notice: only commands with an asterisk(*) are supported within this option

export DOCKER_HOST=tcp://containers-api.ng.bluemix.net:8443
export DOCKER_CERT_PATH=/home/compute/.ice/certs
export DOCKER_TLS_VERIFY=1

Example Usage:
docker ps
docker images</i>

设置DOCKER_HOST,DOCKER_CERT_PATH和DOCKER_TLS之后,docker ps和docker image命令给出了正确的结果。

然后,我按照说明重写我的容器标签:

docker tag [my_image_name] registry.ng.bluemix.net/container_registry/[my_image_name]

执行:

docker push registry.ng.bluemix.net/container_registry/[my_image_name]

给出错误:

`Error response from daemon: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>`

我在〜/ .ice目录中找到了./ibm-container脚本,它将身份验证值添加到docker命令,同样的错误。

没有证书,我被问到姓名,密码和电子邮件;它不允许我使用我的bluemix凭据进行访问。

1 个答案:

答案 0 :(得分:1)

如前面的评论中所述,您的描述中存在问题: - 按照@adasilva的建议检查您的docker守护程序设置,它似乎没有运行,它不会阻止您在Bluemix上标记图像,但最好还是让它在本地运行 - 根据您的描述,您使用的是注册表名称“container_registry”,它不应该是您的名称(除非您已成功注册):您可以使用

检索它
cf ic info

然后将您的注册表替换为“container_registry”:现在您应该能够标记/推送Bluemix容器