Warning, this implies a security risk as all communications will be done unencrypted. Also, exposing a docker daemon externally, allows others to manage containers on your host. By default - this is disabled and Docker daemon listens on a socket only.
Run dockerd temporary to listen on local IP 10.10.10.10:
dockerd --debug \
--host=tcp://10.10.10.10:2375
You can also make these changes permanent by adding a file /etc/systemd/system/docker.service.d/settings.conf with the contents:
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H unix:// -H tcp://10.10.10.10:2375
Save and close the file. Reload systemd and restart the docker daemon:
systemctl daemon-reload
systemctl restart docker
Or the third way is to use /etc/docker/daemon.json. Create that file and fill it with the contents:
{
"hosts": ["unix:///var/run/docker.sock", "tcp://10.10.10.10:2375"]
}
After setup - check listening port:
sudo netstat -lntp | grep dockerd
or:
sudo ss -lntp | grep dockerd
Next, connect to Docker daemon remotely from another machine:
export DOCKER_HOST="tcp://10.10.10.10:2375"
docker ps -a
or directly, if you do not want to declare environment variable:
DOCKER_HOST="tcp://10.10.10.10:2375" docker ps -a