I’ve had to set up a couple instances of PhotonOS in my testing remote docker with test-kitchen. Here are my notes on how to get the PhotonOS prep’d and allowing for remote connections.

First you need to enable PermitRootLogin yes at the bottom of the file:

root@photon-iso [ ~ ]# vi /etc/ssh/sshd_config

After that you need to allow for iptables to open the port for the docker process:

root@photon-iso [ ~ ]# iptables -A INPUT -p tcp --dport 2375 -j ACCEPT

You’ll need to add -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock to the end of ExecStart

root@photon-iso [ /usr/lib/systemd/system ]# vi docker.service.d/10-dockerd.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
root@photon-iso [ /usr/lib/systemd/system ]#

Then start the process!

root@photon-iso [ ~ ]# systemctl start docker

You can verify your connection with a remote machine via:

$ DOCKER_HOST=tcp://IPOFMACHINE:2375 docker info