Bluemix:无法访问本地Docker守护程序以对其进行身份验证

时间:2016-01-27 13:17:23

标签: docker containers ibm-cloud cloudfoundry

我遇到了几乎相同的问题,如thread所述。不幸的是,这个帖子中提供的答案并没有解决我的问题。

cf login工作正常

cf ic登录失败:

$ sudo cf ic login
Password:
Client certificates are being retrieved from IBM Containers...
Client certificates are being stored in /Users/XX/.ice/certs/...
Client certificates are being stored in /Users/XX/.ice/certs/containers-api.eu-gb.bluemix.net/bd67571...
OK
Client certificates were retrieved.

Deleting old configuration file...
Checking local Docker configuration...

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.

You can choose from two ways to use the Docker 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.
Use this Cloud Foundry IBM Containers plug-in without affecting the local Docker environment:

Example Usage:
cf ic ps
cf ic images



Option 2: Use the Docker CLI directly. In this shell, override the local Docker environment to connect to IBM Containers by setting these variables. Copy and paste the following commands:
Note: Only Docker commands followed by (Docker) are supported with this option. 

export DOCKER_HOST=tcp://containers-api.eu-gb.bluemix.net:8443
export DOCKER_CERT_PATH=/Users/XX/.ice/certs/containers-api.eu-gb.bluemix.net/bd675...
export DOCKER_TLS_VERIFY=1

我在提到的线程中尝试了这个建议并运行了eval“$(docker-machine env default)”。 结果,命令'docker images'和'docker ps正在执行正常。

然后,如果我跑

cf login 
cf ic login 

执行cf ic login时出现上述错误。我也尝试了选项2作为建议的错误消息,但这也无济于事。

1 个答案:

答案 0 :(得分:0)

我能够重新创建您在Mac中使用sudo运行cf logincf ic login时看到的错误。如果我在没有sudo的情况下运行,则cf ic login可以正常运行。

运行所有命令,不用 sudo

$ cf login 

$ cf ic login 
Client certificates are being retrieved from IBM Containers...
Client certificates are being stored in /Users/adasilva/.ice/certs/...
Client certificates are being stored in /Users/adasilva/.ice/certs/containers-api.ng.bluemix.net/ef4c3396-1d7a-4843-8d05-fd255b6899d2...
OK
Client certificates were retrieved.

Deleting old configuration file...
Checking local Docker configuration...
OK

Authenticating with registry at host name registry.ng.bluemix.net
OK
Your container was authenticated with the IBM Containers registry.
Your private Bluemix repository is URL: registry.ng.bluemix.net/adasilva

You can choose from two ways to use the Docker 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.
    Use this Cloud Foundry IBM Containers plug-in without affecting the local Docker environment:

    Example Usage:
    cf ic ps
    cf ic images

Option 2: Use the Docker CLI directly. In this shell, override the local Docker environment to connect to IBM Containers by setting these variables. Copy and paste the following commands:
    Note: Only Docker commands followed by (Docker) are supported with this option. 

    export DOCKER_HOST=tcp://containers-api.ng.bluemix.net:8443
    export DOCKER_CERT_PATH=/Users/adasilva/.ice/certs/containers-api.ng.bluemix.net/ef4c3396-1d7a-4843-8d05-fd255b6899d2
    export DOCKER_TLS_VERIFY=1

    Example Usage:
    docker ps
    docker images