DockerDaemonConnectionError when setting up Google Cloud virtual machine in Ubuntu

I am trying to install the Google Cloud Managed VM in Ubuntu according to these guides: [1] , [2]

I installed Docker in accordance with the Docker Installation Guide .

Starting docker with: sudo docker -H tcp://127.0.0.1:2376 -d

I created certificate keys in accordance with the HTTPS Docker guide .

My environment variables:

  • DOCKER_HOST = TCP: //: 2376
  • DOCKER_TLS_VERIFY = 1
  • DOCKER_CERT_PATH = / house / eyalev / h

When I run gcloud preview app setup-managed-vms

I get an error message:

https://gist.github.com/eyalev/aab86463bc63f4319d5c

 Traceback (most recent call last): File "/home/eyalev/Software/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 153, in <module> main() File "/home/eyalev/Software/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 149, in main _cli.Execute() File "/home/eyalev/Software/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 381, in Execute post_run_hooks=self.__post_run_hooks, kwargs=kwargs) File "/home/eyalev/Software/google-cloud-sdk/./lib/googlecloudsdk/calliope/frontend.py", line 274, in _Execute pre_run_hooks=pre_run_hooks, post_run_hooks=post_run_hooks) File "/home/eyalev/Software/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 887, in Run result = command_instance.Run(args) File "/home/eyalev/Software/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/setup_managed_vms.py", line 37, in Run setup_registry.SetupRegistry() File "/home/eyalev/Software/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/setup_registry.py", line 32, in SetupRegistry timeout=config.DOCKER_D_REQUEST_TIMEOUT) File "/home/eyalev/Software/google-cloud-sdk/platform/google_appengine/google/appengine/tools/docker/containers.py", line 663, in NewDockerClient 'Couldn\'t connect to the docker daemon using the specified ' google.appengine.tools.docker.containers.DockerDaemonConnectionError: Couldn't connect to the docker daemon using the specified environment variables. Please check the environment variables DOCKER_HOST, DOCKER_CERT_PATH and DOCKER_TLS_VERIFY are set correctly. If you are using boot2docker, make sure you have run "$(boot2docker shellinit)" 

Is there something I am missing?

+7
python google-compute-engine google-cloud-platform
source share
3 answers

I finally got gcloud preview app setup-managed-vms to work on ubuntu. Here is what I had to do:

  • get docker 1.3.0, not 1.3.1. sudo apt-get install docker.io and the old version of docker on my machine, so I had to remove this first. But curl -sSL https://get.docker.com/ubuntu/ | sudo sh curl -sSL https://get.docker.com/ubuntu/ | sudo sh installs version 1.3.1, which also does not work. I lost every line in the script at https://get.docker.com/ubuntu/ , but I had to change the last line of apt-get install -y lxc-docker to apt-get install -y lxc-docker-1.3.0 . Official docs mention that the application engine doesn't work with boot2docker 1.3.1, but I think they meant that it doesn't work with docker 1.3.1.

  • I could not get 127.0.0.1 to work as my hostname. I had to use localhost when creating the ca and server certificates.

  • I had to export DOCKER_HOST=tcp://localhost:2376 (note the use of localhost) along with DOCKER_TLS_VERIFY=1 and DOCKER_CERT_PATH=<path>

  • I set DOCKER_OPTS in / etc / default / docker to "--tlsverify --tlscacert=<path>/ca.pem --tlscert=<path>/server-cert.pem --tlskey=<path>/server-key.pem -H=0.0.0.0:2376"

gcloud preview app setup-managed-vms working now, but I haven't got gcloud preview app run yet for my application to work.

+7
source share

Not sure if this will help, but you can try with a more explicit DOCKER_HOST:

 DOCKER_HOST=tcp://localhost:2376 
+1
source share

I installed Docker 1.3.2 from unstable (Debian), added

 DOCKER_OPTS="-d -H fd:// -H tcp://localhost:2375" 

to /etc/default/docker and install

 DOCKER_HOST=tcp://localhost:2375 

for it to work.

This site contains information on how to configure the default Docker settings for CoreOS (systemd) https://coreos.com/docs/launching-containers/building/customizing-docker/

0
source share

All Articles