0

So I wanted to enable remote docker, to use the API for the daemon from outside the host.

My /etc/docker/daemon.json looks like this:

{
  "hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]
}

And my /etc/systemd/system/docker.service.d/options.conf looks like this:

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd

When i try to list all Containers using the curl command on the host with localhost it works:

curl localhost:2375/v1.38/containers/json

i get a json-list of all Containers. []

But if i try using:

curl 10.1.44.11:2375/v1.38/containers/json

i only get a empty json back: []

when i run:

sudo netstat -ltnp | grep dockerd

I get:

tcp6 0 0 :::2375 :::* LISTEN xxx/dockerd

I am kind of confused why it show tcp6 instead of tcp.

can someone help?

  • What is this IP address 10.1.44.11 which you have tried? is it available for ping command? If not check by adding this to your /etc/hosts file – PavanDevarakonda May 04 '23 at 16:05
  • @PavanDevarakonda 10.1.44.11, is the IP of the Host which the Docker daemon is running on, sorry for not specifying. the ping command works. Do i have to make an entry in host file? – Joseph Adam May 05 '23 at 06:09

0 Answers0