by Chris Adams
One of the many great things about Photon OS, VMware’s Cloud Native Apps container host, is that it is open source. The project is hosted on the VMware Github source code repository to download and build from source using the latest code. There are several builds that can be done depending on your needs. You can build ISO’s, Azure images, Amazon AMI images, Google Compute Engine images, etc. Of course, you can also download pre-build images from the Photon OS download page at the Photon OS web site if you are in a rush or want a more official release.
Downloading an official release is the way to go if you want something pre-built and at a defined release level. I sometimes want to try a version with the most up-to-date commits or to get a new feature that hasn’t been included in the latest stable release yet. You may also want to change something in the Photon codebase yourself too since it is open source.
The easiest way to get everything built so you can evaluate the many options is to build them all at once. The following directions will walk you through the steps necessary to build everything on an Ubuntu based Linux system (VM or host). I used Linux Mint 17.2 but Ubuntu (14.x or 15.x) or any Ubuntu derivative should work fine. All command run inside the Photon build system will be in Courier font.
First, we need to ensure some required software is installed:
sudo apt-get install bison gawk g++ createrepo python-aptdaemon genisoimage texinfo python-requests git vim
Now install Docker:
wget -qO- https://get.docker.com/ | sh
Allow your user to run docker (change NAME to your username):
sudo usermod -aG docker NAME
By default on Linux Mint (and most other Ubuntu based distributions), /bin/sh is a symbolic link to /bin/dash. We want to use /bin/bash instead of /bin/dash so update the link to point to bash. This can be reverted when you are done building Photon by linking /bin/sh back to /bin/dash.
sudo ln -sf /bin/bash /bin/sh
Make a directory for the repo and change into directory:
Clone the Photon git repo from github:
git clone https://github.com/vmware/photon.git
Change directory into the newly created photon directory:
Begin the build process:
sudo make all
This process will take a while to complete. You might want to start it before going to bed or run it in the background while doing other things throughout the day. The output of the build process will store your freshly built material in the repos/photon/stage directory. You will see ISO files as well as several other directories. Explore the contents and enjoy your freshly built Photon binaries including the ISO’s you can use to build Photon VM’s.