Stuart winchester in Coding 3 minutes

Docker Certificate Workaround

Sometimes there can be issues with certificates when using docker and the cdk… I love certs.

[user@localhost rhel-ose]$ vagrant service-manager env docker
# Copying TLS certificates to /home/user/cdk/components/rhel/rhel-ose/.vagrant/machines/default/virtualbox/docker
# Set the following environment variables to enable access to the
# docker daemon running inside of the vagrant virtual machine:
export DOCKER_HOST=tcp://
export DOCKER_CERT_PATH=/home/user/cdk/components/rhel/rhel-ose/.vagrant/machines/default/virtualbox/docker

# run following command to configure your shell:
# eval "$(vagrant service-manager env docker)"
[user@localhost rhel-ose]$ eval "$(vagrant service-manager env docker)"
[user@localhost rhel-ose]$ docker ps
An error occurred trying to connect: Get x509: certificate is valid for, not

Instead, just ignore certs…

[user@localhost rhel-ose]$ docker --tlsverify=false ps
CONTAINER ID        IMAGE                                                                                                     COMMAND                  CREATED             STATUS              PORTS               NAMES
ff005f38d931   "container-entrypoint"   About an hour ago   Up About an hour                        k8s_ruby.92e1b6e5_ruby-1-1w0m8_rubers_b3e1a0c7-1e07-11e7-8939-5254002dd172_5189f9f9
73fec709a853        openshift3/ose-pod:v3.4.0.40                                                                              "/pod"                   About an hour ago   Up About an hour                        k8s_POD.9a18fe14_ruby-1-1w0m8_rubers_b3e1a0c7-1e07-11e7-8939-5254002dd172_f37ddb56

Obviously, this is just a work around for getting this stuff working locally. The real fix is to use the correct cert, but I believe there was a problem here with the CDK. Since this article I’ve moved on to using minishift. :)