Search code examples
dockercontainersibm-cloudcloud-foundry

Bluemix: local Docker daemon is not reachable to authenticate it


I am having almost the same problem, as described in this thread. Unfortunately, the provided answer in this thread does not solve my issue.

cf login works fine

cf ic login fails:

$ 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

I tried the suggestion in the mentioned thread and ran eval "$(docker-machine env default)". As a result, the command 'docker images' and 'docker ps were executing fine.

Then, if I run

cf login 
cf ic login 

I get the error above when executing cf ic login. I also tried Option 2 as the error message suggested, but that doesn't help either.


Solution

  • I was able recreate the error you are seeing when I run cf login and cf ic login with sudo in Mac. If I run without sudo then cf ic login works fine.

    Run all commands without 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