8

I'm trying to run a Dart app on my machine, to be eventually deployed on Google App Engine. I've followed the instructions found on this page

https://www.dartlang.org/cloud/

The difference is I already have a local docker daemon running, which I'd like to use, and don't really want to use VirtualBox. The instructions assume you are using boot2docker, which insists on using VirtualBox to install an VirtualBox VM and run the docker daemon on this. Everytime I try and run

gcloud preview app run app.yaml

I get

google.appengine.tools.docker.containers.DockerDaemonConnectionError: 
Couldn't connect to the docker daemon because the required environment 
variables were not set. 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)

I sense from what I've read, that you don't have to use boot2docker, and use a local docker daemon instance. The problem is I can't find any instructions on how to do this. I am hoping someone can answer this for me. Also the error message I am given doesn't help me, as any google search I do keeps giving me the same answer of use, boot2docker.

James Hurford
  • 2,018
  • 19
  • 40

1 Answers1

3

I installed Docker 1.3.2 from unstable (Debian), added

DOCKER_OPTS="-d -H unix:///var/run/docker.sock -H tcp://localhost:2375"

to /etc/default/docker, and set

DOCKER_HOST=tcp://localhost:2375

to make it work.

This page http://docs.docker.com/articles/https/ contains more information about how to configure docker for HTTPS.

I created an issue https://github.com/dart-lang/www.dartlang.org/issues/1162 to update the setup instructions for Dart.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • Though I'm running docker through systemd, but this pretty much answers my question, even if the answer is also found in another duplicate question – James Hurford Nov 26 '14 at 01:04
  • I just found this, as I faced the same issue, and edited the mentioned file by adding the 2 lines above, still getting this error: '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)" – Hasan A Yousef Feb 19 '15 at 10:18
  • Restart Docker `sudo /etc/init.d/docker restart` after the change and check with `echo $DOCKER_HOST` if the setting of the variable is active. – Günter Zöchbauer Feb 19 '15 at 10:39