Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect to the Docker daemon at tcp://docker.example.com:2376. Is the docker daemon running? #18

Open
kariae opened this issue Oct 26, 2020 · 1 comment

Comments

@kariae
Copy link

kariae commented Oct 26, 2020

I run the image through docker-compose everything from the logs looks fine but when I try to connect to the Docker daemon from my local computer I have this error, I checked the port with nmap and it's open

I have swarm and traefik running on the server, so I tried to deploy the image on swarm and expose the port using traefik, I had the same issue

Any idea where I can debug this, please?

@kekru
Copy link
Owner

kekru commented Oct 26, 2020

You could try if you can connect with curl. Maybe then you find the problem.
For me this works:

# Checkout this git repo
$ docker-compose up -d
$ curl -v --cacert certs/client/ca.pem --cert certs/client/cert.pem --key certs/client/key.pem https://abc.127.0.0.1.nip.io:8443/containers/json

* Uses proxy env variable no_proxy == '192.168.99.100'
*   Trying 127.0.0.1:8443...
* Connected to abc.127.0.0.1.nip.io (127.0.0.1) port 8443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: certs/client/ca.pem
  CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Request CERT (13):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS handshake, CERT verify (15):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=abc.127.0.0.1.nip.io
*  start date: Oct 10 22:14:39 2020 GMT
*  expire date: Oct 10 22:14:39 2021 GMT
*  subjectAltName: host "abc.127.0.0.1.nip.io" matched cert's "abc.127.0.0.1.nip.io"
*  issuer: C=GB; ST=London; L=London; O=ExampleCompany; OU=IT; CN=example.com; [email protected]
*  SSL certificate verify ok.
> GET /containers/json HTTP/1.1
> Host: abc.127.0.0.1.nip.io:8443
> User-Agent: curl/7.71.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Api-Version: 1.40
< Content-Type: application/json
< Date: Mon, 26 Oct 2020 19:02:42 GMT
< Docker-Experimental: false
< Ostype: linux
< Server: Docker/19.03.13 (linux)
< Transfer-Encoding: chunked
<
[{"Id":"3c465cf46f5d6f9575befe1cb515deaded55fed366f1d8e7df12da2cc2218313","Names":["/docker-remote-api-tls_remote-api_1"],"Image":"docker-remote-api-tls_remote-api","ImageID":"sha256:bc402743710f62d52a4f8ed69cb2f60aea76c3463c71cd9355be1ea7f773f733","Command":"/docker-entrypoint.sh nginx -g 'daemon off;'","Created":1602600275,"Ports":[{"IP":"0.0.0.0","PrivatePort":443,"PublicPort":8443,"Type":"tcp"},
...
* Connection #0 to host abc.127.0.0.1.nip.io left intact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants