Tags

Problem: When running any docker command, the error below is printed

$ docker version

Client:
Version: 1.12.0-rc3
API version: 1.24
Go version: go1.6.2
Git commit: 91e29e8
Built: Sat Jul 2 00:17:11 2016
OS/Arch: windows/amd64
An error occurred trying to connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version: open //./pipe/docker_engine: The system cannot find the file specified.

$ docker ps -a

An error occurred trying to connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json?all=1: open //./pipe/docker_engine: The system cannot find the file specified.

Solution:
We need to configure the shell to be able to execute docker commands.

webdev@localhost ~
$ docker-machine env

export DOCKER_TLS_VERIFY=”1″
export DOCKER_HOST=”tcp://192.168.99.100:2376″
export DOCKER_CERT_PATH=”C:\Users\webdev\.docker\machine\machines\default”
export DOCKER_MACHINE_NAME=”default”
# Run this command to configure your shell:
# eval $(“C:\Program Files\Docker Toolbox\docker-machine.exe” env)
For cmd, use this command:

eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env)

For cygwin, use this command:

$ eval $("C:/Program Files/Docker Toolbox/docker-machine.exe" env default)

For set permanent variable easily:
1.Right-click on the Windows Button
2.Select System, from the menu.
3.From there, select “Advanced system settings” → “Environment Variables”
4.Under the System Variables section, add all variables displayed when you ran the command: docker-machine env

Advertisements