VMWare released “Photon” earlier this week, which is a lightweight Linux OS for hosting Docker containers. It’s amazingly slim like CoreOS and deploys in a matter of seconds. I gave it a spin today and it worked pretty well. Installing it on vSphere was pretty straightforward following documentation on the Photon GitHub site. Once it was installed, I needed to make a few changes to get it working smoothly.

Setting the proxy

If your environment uses a proxy to connect to the internet, continue with this section. If not, skip.

First, create a new directory to store the extra configuration.

1
mkdir /etc/systemd/system/docker.service.d

Next, create a http-proxy.conf file in the directory and edit it.

1
2
touch /etc/systemd/system/docker.service.d/http-proxy.conf
nano /etc/systemd/system/docker.service.d/http-proxy.conf

Add the following information to the file (substituting where necessary) and save with Ctrl + X.

1
2
[Service]
Environment="HTTP_PROXY=http://username:password@proxy.example.com:8080/"

Reload the systemd daemon and restart Docker.

1
2
systemctl daemon-reload
systemctl restart docker

Docker now has access to the internet.

Allow Docker connection via TCP

By default, Docker only allows connection through UNIX sockets. Since we will be controlling it via the Windows client, we need TCP access.

Open up the Docker service file in nano

1
nano /etc/systemd/system/multi-user.target.wants/docker.service

Edit the Service -> ExecStart line to allow TCP connections by changing:

1
ExecStart=/bin/docker -d -s overlay

to

1
ExecStart=/bin/docker -d -s overlay -H tcp://0.0.0.0:2375

Reload the systemd daemon and restart Docker.

1
2
systemctl daemon-reload
systemctl restart docker

Upgrade the Docker binary

Photon comes with Docker 1.5.0 but unfortunately the Windows client only works with 1.6.0 and above.

If you are using a corporate proxy, you will first need to set the http_proxy environmental variable so wget works

1
export https_proxy="http://username:password@proxy.example.com:8080/"

Download the Docker 1.6.0 binary

1
wget https://get.docker.com/builds/Linux/x86_64/docker-1.6.0

Move the binary to /bin/ and mark it as executable

1
2
3
4
5
systemctl stop docker
rm -r /bin/docker
mv docker-1.6.0 /bin/docker
chmod +x /bin/docker
systemctl start docker

You will now have Docker 1.6.0 running.

Connecting from Windows

Download Docker 1.6.0 for Windows from Docker.com - 32-bit or 64-bit and open PowerShell in that directory. At this point I recommend renaming the file to docker.exe.

To connect to the Photon host, run the following:

1
.\docker.exe -H=tcp://photon.ip.address.here:2375 info

This will show information about the Docker host like so:

1
2
3
4
5
6
7
8
9
10
11
Containers: 12
Images: 49
Storage Driver: overlay
Backing Filesystem: extfs
Execution Driver: native-0.2
Kernel Version: 3.19.2
Operating System: <unknown>
CPUs: 2
Total Memory: 489.7 MiB
Name: bvdocker1
ID: <id here>

You are now connected!

Comment and share

  • page 1 of 1

Jacob Ludriks

author.bio


author.job