Using BlueMix Container Registry service without local docker running

9/4/2017

I am using Minikube to test everything I deploy in IBM Bluemix kubernetes service. I have my Macbook docker environment configured to use Minikube and I don't start standard basic Docker daemon/service in my MacBook. I just:

eval $(minikube docker-env)

It works great and I use same yaml files in Minikube than then I apply to Bluemix, as I use that Docker and Minikube image registry. Problem: when I try to login to BX CR to push an image from Minikube registry I get:

MacBook-Pro:Docker and Kubernetes icordoba$ bx cr login
Logging in to 'registry.ng.bluemix.net'...
FAILED
Failed to 'docker login' to 'registry.ng.bluemix.net' with error: Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?). Using system default: https://index.docker.io/v1/
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
.

It seems bx cr login command needs local docker host daemon running so I need to build image into Minkube registry, test in Minikube, shut it down, start Docker, build image again i docker registry, login to bx cr and push the image...

Can I make bx cr login command work with Minikube docker environment and not basic docker environment configured?

-- icordoba
container-registry
docker
ibm-cloud
kubernetes
minikube

1 Answer

9/6/2017

As mentioned in the comments the docker CLI is a pre-requirement for pushing to and pulling from the registry.

It should be possible to ssh into minikube using minikube ssh allowing you access to the docker daemon within minikube. You would then need to install the Bluemix cli and cr plugin. It should then be possible to push your images from there.

Alternatively you could install the IBM-Containers plugin found here. Then you can build your container in Bluemix and it will automatically push the image into the Container Registry for you to use with Kubernetes. This would allow you to build and push images without access to a docker daemon.

bx ic build -t registry.ng.bluemix.net/<namespace>/<image>:<tag> DOCKERFILE_PATH

(Adjust the registry region prefix based on which region you want your image to be pushed to)

-- Liam White
Source: StackOverflow