1

I want to play with hyperledger fabric and this require to have linux. Right now I want to use Windows and my idea was to install Ubuntu with WSL and just develop inside it. The problem apear when I want to use docker.

I follow the steps in this tutorial step by step but I run into some problem.

filip@CSGN044D:~$ docker --version
Docker version 19.03.5, build 633a0ea838


filip@CSGN044D:~$ docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.


filip@CSGN044D:~$ sudo service docker start
 * Starting Docker: docker

and again...

filip@CSGN044D:~$ docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.

Is this even possible ?

4
  • Have you tried running as superuser sudo docker run hello-world? Commented Jan 28, 2020 at 14:28
  • yes, doesn't help Commented Jan 28, 2020 at 14:30
  • 3
    Try running DOCKER_HOST=tcp://localhost:2375 docker info and see if it works Commented Jan 28, 2020 at 14:50
  • yea, this work, I left the tutorial in the comment Commented Jan 28, 2020 at 15:03

1 Answer 1

2

Looks like your Docker CLI is still trying to connect to the local Unix socket instead of localhost. Make sure your DOCKER_HOST environment variable is set to tcp://localhost:2375

Try by setting it in your shell first

export DOCKER_HOST=tcp://localhost:2375

Sanity check

echo $DOCKER_HOST

Now try running all your regular Docker commands. If those work, add this to your .bashrc

echo "export DOCKER_HOST=tcp://localhost:2375" >> ~/.bashrc
source ~/.bashrc

Not that in the tutorial the author uses localhost:2375 instead of tcp://localhost:2375. I think you have to explicitly specify the protocol. Also, your shell might not be using bash_profile as the config file (Usually Mac shells use that) so try adding it to your bashrc instead.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.