Bluemix Docker Container cf ic ic无法登录本地Docker守护程序以进行认证 [英] Bluemix Docker Container cf ic login the local Docker daemon is not reachable to authenticate

查看:71
本文介绍了Bluemix Docker Container cf ic ic无法登录本地Docker守护程序以进行认证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照说明使用ic插件处理docker容器和Bluemix。当我运行命令时:

I am running through the directions to work with docker containers and Bluemix using the ic plugin. When I run the command:

cf ic登录

我收到消息:


您的系统已通过IBM Containers API进行了身份验证,但是
本地Docker守护程序未通过身份验证可通过IBM
容器注册表对其进行身份验证。您仍然可以在云上运行IBM Containers,但
将无法推送或拉取图像。

Your system was authenticated with the IBM Containers API, however the local Docker daemon is not reachable to authenticate it with the IBM Containers registry. You can still run IBM Containers on the cloud but will not be able to push or pull images.

如果我工作使用docker本地而不运行cf ic登录,一切似乎都很好。

If I work with docker locally without running the cf ic login, all seems to be fine.

在cf ic登录后,如果我运行任何docker命令,例如:

Following the cf ic login, if I run any docker commands such as:

docker标签ibmjstart / bluemix-wordpress Registry.ng.bluemix.net/myNamespace/wordpress

命令失败,并显示以下消息:

the commands fail with the message:


守护程序的错误响应:405不允许方法

不允许方法

所请求的方法不允许URL。

Error response from daemon: 405 Method Not Allowed

Method Not Allowed

The method is not allowed for the requested URL.

任何有关检查事项的指导都将受到赞赏。谢谢!

Any guidance on things to check is greatly appreciated. Thanks!

推荐答案

V.Bontempi提供的答案非常有帮助,可能只是我不太了解他是什么说明,但要澄清的是,实际上是将env变量设置为专门指向Bluemix ,这引起了问题。设置环境变量时

The answer that V.Bontempi provided was extremely helpful and it may just have been me not quite grasping what he was stating, but to clarify it was actually setting the env variables to point exclusively to Bluemix which was causing the issue. When you set the env variables

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

这告诉docker仅与Bluemix和本地实例一起使用。因此,如果我设置了env变量,那么在尝试使用本地图像并按照此处找到的教程对其进行标记后,便会这样做:

This tells docker to work exclusively with Bluemix versus the local instance. So, if I set the env variables, after doing this when I attempted to work with a local image and tag it as per the tutorial found here:

Bluemix容器上的WordPress

,我尝试运行命令:

docker tag ibmjstart/bluemix-wordpress registry.ng.bluemix.net/[namespace]/wordpress

使用我的命名空间,该命令将失败并出现405错误。另一方面,如果我运行以下命令序列而没有导出,则一切都会按预期进行:

using my namespace, the command would fail with a 405 error. On the other hand, if I run the following sequence of commands without the export, everything works as expected:

cf login
cf ic login [-a https://api.ng.bluemix.net] [-H https://containers-api.ng.bluemix.net/v2/containers] [-R registry.ng.bluemix.net]
docker tag ibmjstart/bluemix-wordpress registry.ng.bluemix.net/myNamespace/wordpress
docker push registry.ng.bluemix.net/[namespace]/wordpress

支持团队向我提供了以下解释:

The support team provided me with the following explanation:

1)安装并配置docker在本地工作
这是您首先需要做的,因此您可以在本地将映像创建,然后再推送到Bluemix中的IBM Containers。
要执行此步骤,您必须配置docker环境变量。为此,您可以运行以下命令:
eval $(docker-machine env default)

1) Install and configure docker to work locally This is the first think you need to do, so you can create your images locally before pushing to IBM Containers in Bluemix. For this step to work you have to configure docker environment variables. To do this you can run the following command: eval "$(docker-machine env default)"

这将为您的本地docker设置环境变量。如果不设置此变量,Docker将无法工作。
设置此选项后,您可以尝试使用基本的docker命令,例如:

This will set the environment variables for you local docker. Docker will not work if you not set this variables. After setting this you can try basic docker commands, like:

      docker images
      docker ps

您将注意到,如果您未设置环境变量,这些命令将不起作用。

You will notice that these commands would not work if you have not set the environment variables.

2)登录到Bluemix和IBM Containers
现在已经安装并配置了docker,您可以使用以下命令登录:

2) Log in to Bluemix and IBM Containers Now that docker is installed and configured you can log in with the following commands:

       cf login 
       cf ic login 

After that you can start playing with your images and pushing them to IBM Containers in Bluemix once they are ready.

感谢Bluemix支持团队的帮助!

Thanks to the Bluemix support team for the help!

这篇关于Bluemix Docker Container cf ic ic无法登录本地Docker守护程序以进行认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆