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

Bluemix: local Docker daemon is not reachable to authenticate it

我遇到了与此 thread 中描述的几乎相同的问题。不幸的是,此线程中提供的答案无法解决我的问题。

cf 登录正常

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,但这也无济于事。

当我在 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