user1907849
user1907849

Reputation: 990

Docker client communicating with docker host

I have a docker daemon installed in UbuntuA machine.

I am using UbuntuB machine as the docker client. I know that UbuntuA machine has the docker daemon installed and can do operations as well.

But I am not getting on which port it is running. I am using this command : sudo docker -H tcp://127.0.0.1:5555 -d &

and after this , when I use the following command: sudo docker -H tcp://127.0.0.1:5555 info

I am getting an error : docker daemon not found . How to find out on which port , the daemon is running?

Upvotes: 0

Views: 3148

Answers (1)

Thomasleveil
Thomasleveil

Reputation: 104205

Using the -H tcp://127.0.0.1:5555 docker daemon option on the UbuntuA machine will instruct docker to bind to the loopback network interface (127.0.0.1). As a result it will only accept connections originating from the UbuntuA machine.

If you want to accept connections incoming from any network interface use -H tcp://0.0.0.0:5555. Be aware that anyone that would be able to connect to your UbuntuA machine on port 5555 will be able to control your docker host. You need to protect it with firewall rules to allow only UbuntuB to connect to UbuntuA on port 5555.

Upvotes: 3

Related Questions