Etienne Noël
Etienne Noël

Reputation: 6176

Docker cannot run hello-world from client

I am trying to setup Docker for the first time. So, I'm following the guide here: https://docs.docker.com/machine/get-started/

Now, when I get to the following command:

docker run busybox echo hello world

I get the following error:

$ docker run hello-world
C:\Program Files\Docker Toolbox\docker.exe: An error occurred trying to connect: Post https://192.168.99.101:2376/v1.23/containers/create: Service Unavailable.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

Now, I am behind a corporate proxy so that may be the cause of my problem. I set it up according to what's mentioned in this article: http://mflo.io/2015/08/13/docker-machine-behind-proxy/. I did:

docker-machine ssh default

  # now the command prompt will say something like:
  # docker@default:~$

  # we need root access:
  sudo -s

  # now the command prompt will say something like:
  # root@default:~$

  # now configure the proxy
  echo "export HTTP_PROXY=http://[uid]:[pw]@corporate.proxy.com:[port]" >> /var/lib/boot2docker/profile
  echo "export HTTPS_PROXY=http://[uid]:[pw]@corporate.proxy.com:[port]" >> /var/lib/boot2docker/profile

  # for verification
  cat /var/lib/boot2docker/profile

  # exit out of ssh session
  exit
  exit

  # restart
  docker-machine restart default

  # now you should be able to proceed with installation steps
  docker run hello-world

On the Docker-Machine, I got absolutely no problem with the "docker run hello-world" as well as "docker run busybox echo hello world"

However, on my computer, this same command always return the same error...

Upvotes: 1

Views: 469

Answers (2)

Fabián Bertetto
Fabián Bertetto

Reputation: 1966

Try:

docker-machine stop default
docker-machine start default

And then run your application sometimes restart doesn't update networking configuration.

Upvotes: 1

Etienne Noël
Etienne Noël

Reputation: 6176

I had to put the address of the docker machine inside the no_proxy of my environment variable.

Like this (https://msdn.microsoft.com/en-us/library/hh272656%28v=vs.120%29.aspx?f=255&MSPPError=-2147217396):

no_proxy -- Determine hosts that should bypass the proxy. For example, NO_PROXY=”localhost,.mycompany.com,192.168.0.10:80”

Upvotes: 1

Related Questions