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

“host(s)” flag doesn't work in daemon.json, but work fine in dockerd -H #38310

Closed
Eroyi opened this issue Dec 3, 2018 · 3 comments
Closed

Comments

@Eroyi
Copy link

Eroyi commented Dec 3, 2018

For Portainer's remote endpoint access freture.
on Ver 18.09 in CentOS 7.5, If I run
dockerd -H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375 &
The log shows

INFO[2018-12-03T16:39:20.721535513+08:00] API listen on [::]:2375                      
INFO[2018-12-03T16:39:20.721559701+08:00] API listen on /var/run/docker.sock 

The whole connection work just fine, can be telnet, and can be access by Portainer.

But, if I configure /etc/docker/daemon.json with
{ "host": ["tcp://0.0.0.0:2375"],"host": ["unix:///var/run/docker.sock"] }
or some other similar way, the log shows

localhost.localdomain dockerd[10349]: time="2018-12-03T16:47:00.735319699+08:00" level=info msg="API listen on /var/run/docker.sock"

the port is missing in log yes, and the port is also dead.

So is there any way to make this configuration right with daemon.json?

@Eroyi
Copy link
Author

Eroyi commented Dec 27, 2018

Okay, problem solve.
The default docker.service script contain these argument:

ExecStart=/usr/bin/dockerd -H

That's why the daemon.json doesn't work, because these broken argument, the "host(s)" config in "daemon.json" cannot work properly, just delete the "-H" and restart.

And for the reply: @olljanat

@Civarey Can you share why you would like enable unencrypted and unsecure TCP port to Docker engine? Portainer works just fine with default docker socket.

I got multiple docker instance in LAN, its too inconvenient and unnecessary to SSL everything,

@olljanat
Copy link
Contributor

I got multiple docker instance in LAN, its too inconvenient and unnecessary to SSL everything,

I highly recommend that you check Portainer agent deployment ( https://portainer.readthedocs.io/en/stable/agent.html ) which allow you to connect multiple docker nodes to one Portainer without enabling TCP port to Docker daemon.

@thaJeztah
Copy link
Member

Closing because of age. Also might be a duplicate / closely related to #25471

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

No branches or pull requests

3 participants