Run Portrait on a hypervisor

The Basics

From an infrastructure perspective, one of the most important aspects of a docker environment is, that applications can be run without the overhead of an operating system. Furthermore, containers are bundled in a single docker application.

However, if you don’t have a Docker environment yet, this guide will show you a simple and fast way to get one.

Single Host Deployment

The following steps will introduce you to run portrait on single virtual machine and focuses on VMware ESXi – other hypervisor scenarios will work in the same fashion.

Prerequisites

For this article, you will need the following setup:

  • ESXi 6.7 (with “Update 3” Patch or higher)

  • Photon OS

Photon OS

Photon OS™ is an open source, minimal Linux container host that is optimized for cloud-native applications, cloud platforms, and VMware infrastructure. Due to ARM64 support, it will also work in Edge and IoT environments. By minimizing the number of packages, focusing on security, and providing advanced lifecycle management, Photon OS delivers just enough of a Linux operating system to efficiently run containers on VMware vSphere, Microsoft Azure, Google Compute Engine, and Amazon Elastic Compute Cloud.

The OS is indeed lightweight and comes as “minimal” configuration as 400 MB package.

Download Photon OS

Photon OS can be either downloaded as ISO or as OVA. In this tutorial, we use OVA, because that’s the fastest way to get it up and running.

Download OVA with virtual hardware v13 (UEFI Secure Boot) to your local computer from here: https://github.com/vmware/photon/wiki/Downloading-Photon-OS#downloading-photon-os-30-ga

There is no need to upload the ova manually to the datastore, this will be done in the next step.

Install Photon OS

Log on to your ESXi web client and create a new VM:

In the wizard, choose “Deploy a virtual machine from an OVF or OVA file”:

Name the new machine and select the file for upload from your local computer:

In step 3 you choose the location of your new VM, accept the license agreement in step 4 and choose deployment settings in step 5:

Finish the wizard in step 6 with a click on “Finish”:

Depending on your connection to the hypervisor, the upload will take a while.

The machine will start, and the first login is done with user “root” and password “changeme”:

Password policy is quite strict, so several tries will be needed.

Change the repository

As of the 25.8.2022 VMWare still hasn’t updated the repos in PhotonOS. Please refer to the following VMWare knowledge base article on how to fix the errors. https://kb.vmware.com/s/article/81304

Setup docker

Inside the machine, execute the following commands:

systemctl start docker systemctl enable docker

The last command will run the service on each startup.

Setup docker-compose

curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose chmod a+rx /usr/local/bin/docker-compose

Install dependencies

Due to its minimalistic approach, we will need some extra packages installed

yum -y install wget yum -y install unzip

Setup Portrait

From here, it’s basically following the setup procedure for portrait: See Install Portrait.

 

Copyright Treskon GmbH.