0
votes

I'm unable to connect to the Docker daemon. I'm running on a Operating System CoreOS, when I run docker info I get the following

error during connect: Get http://127.0.0.1:2375/v1.37/info: http: server closed idle connection

Before I had set the host to port 2375

$ unset DOCKER_TLS_VERIFY

$ unset DOCKER_CERT_PATH

$ export DOCKER_HOST=tcp://127.0.0.1:2375

and Vagrant worked fine: I run vagrant up successfully enter image description here

Why am I getting an error when I try to connect?

docker version

Client: Version: 18.04.0-ce API version: 1.37 Go version: go1.10.1 Git commit: 3d479c0 Built: unknown-buildtime OS/Arch: darwin/amd64 Experimental: false Orchestrator: swarm

coreos-vagrant/user_data

#cloud-config
    coreos:
      units:
        - name: docker-tcp.socket
          command: start
          enable: yes
          content: |
            [Unit]
            Description=Docker Socket for the API
            [Socket]
            ListenStream=2375
            BindIPv6Only=both
            Service=docker.service
            [Install]
            WantedBy=sockets.target
        - name: enable-docker-tcp.service
          command: start
          content: |
            [Unit]
            Description=Enable the Docker Socket for the API
            [Service]
            Type=oneshot
            ExecStart=/usr/bin/systemctl enable docker-tcp.socket

When I run docker-machine ls

enter image description here

2
Does it work if you run docker info from inside the VM? - whites11
@whites11 no it didn't - Steven Aguilar
Why are you trying to configure remote access in the clear text as root without a password to the server? - BMitch
@BMitch im just following the instructions on "Docker up and running" on page 36 github.com/TechBookHunter/Free-Docker-Books/blob/master/book/… - Steven Aguilar
Please take the time to secure the docker socket. Otherwise ssh is pointless, you'd be just as secure if you null out the root password and install a telnet server. docs.docker.com/engine/security/https - BMitch

2 Answers

0
votes

I solved this issue like below;
goto your Docker Desktop -> Settings -> General and then tick "Expose daemon on tcp://localhost:2375 without TLS" checkbox