See this issue.
Docker best practise to Control and configure Docker with systemd.
-
Create
daemon.jsonfile in/etc/docker:{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]} -
Add
/etc/systemd/system/docker.service.d/override.conf[Service] ExecStart= ExecStart=/usr/bin/dockerd -
Reload the systemd daemon:
systemctl daemon-reload -
Restart docker:
systemctl restart docker.service
Exposing the docker daemon on 0.0.0.0 especially on something which faces the internet is a TERRIBLE idea!
It's literally like giving everyone sudo access...
Bind to 127.0.0.1 and portforward.
You don't even have to, the docker client can speak ssh) via:
DOCKER_HOST=“ssh://user@remotehost