So you want to connect to the Docker instance on Photon OS remotly from another Docker client? In this guide I will walk you through a few short steps to configure Photon OS to enable the remote docker API. NOTE: This is not considered the secure method. If you want to use encryption and secure connections I will have a follow up post on that soon.
systemctl stop docker
vi /etc/default/docker
Press i on the keyboard then enter the following, when done press the ESC key then hold Shift and press the Z key twice
DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"
iptables -A INPUT -p tcp --dport 2375 -j ACCEPT
systemctl start docker
To test that it worked, open a web browser to the Photon OS at http://ipaddress:2375/info and you should see the following.
Enjoy!
Pingback: Getting started with VMware Admiral Container Service on Photon OS – VMtoCloud.com
Pingback: Getting started with VMware Admiral Container Service on Photon OS - Cloud-Native AppsCloud-Native Apps - VMware Blogs
Very helpful post. One thing you might want to call out is the fact that that iptable rule will not persist after a reboot. In order for it to save (in case you’re preparing this as a Photon template), you might want to add that rule to /etc/systemd/scripts/iptables at the end of the file after the rule enabling SSH. From there, doing a “systemctl restart iptables” should pick up the rule, followed by an “iptables –list” to verify it was applied.
Hi Ryan, I am trying to run Admiral container on my local Windows 10, version Docker version 1.12.3, build 6b644ec and then add my local server (happens to be on VMW corp network :), so need to enable Docker RemoteAPI here as well.
How can I perform similar config changes to Docker Daemon which currently just has the following settings:
{
“registry-mirrors”: [],
“insecure-registries”: [],
“debug”: false
}
Not using Photon OS @ the moment, hence the question – thanks in advance!
Hi Daniel,
Add this line before “registry-mirrors”: [],
“-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock”,
It also may have changed to something like this in newer Docker versions
{
“hosts”: [“tcp://0.0.0.0:2375”, “unix:///var/run/docker.sock”]
}
Then restart the docker Daemon.
You could have referenced the original post on vmware.com
https://blogs.vmware.com/cloudnative/2016/09/28/enable-docker-remote-api-photon-os/