By default, the Docker daemon generates a socket (/var/run/docker.sock) file for local process communication without listening to any ports, so you can only use the Docker client locally or use the Docker API to do the operation.
If you want to operate the Docker host on another host, you need to have the Docker daemon listen on a port to enable remote communication.
Modify the Docker service startup configuration file, add an unoccupied port number, and restart the Docker daemon.
# Vim/etc/default/docker
docker_opts= "-H 0.0.0.0:5555"
# service Docker restart
It is found that the Docker daemon is already listening on port 5555 and can access the Docker process through that port on another host.
# docker-h ip:5555 Images
But we find that there is a problem with local operation Docker.
# Docker Images
fata[0000] cannot connect to the Docker daemon. Is ' docker-d ' running to this host?
This is because the Docker process only has remote access enabled, and local socket access is not turned on. We modify the/etc/default/docker and then reboot.
# Vim/etc/default/docker
docker_opts= "-H unix:///var/run/docker.sock-h 0.0.0.0:5555"
# service Docker Restart
The Docker process is now accessible both locally and remotely.
Reference documentation
1. http://longgeek.com/2014/09/14/remote-call-docker-api/