In this guide I will show you how to configure Photon OS to start a container when the OS boots up. This way your container is running even if the OS gets powered off or rebooted. Or if you are running on vSphere and an HA event occurs.
SSH into your Photon OS where your container is running and create a service file for the container that you want to auto start at boot time
Use vi editor to create a service file in /etc/systemd/system I named mine docker-admiral.service
Click i and enter the information for the docker container you want to start
If this is not for admiral see items in red below that you will need to change for the container you want to start.
When everything is entered correctly hold Shift then click ZZ on the keyboard to save this file.
[Unit] Description=Admiral container Requires=docker.service After=docker.service [Service] Restart=always ExecStart=/usr/bin/docker start -a admiral ExecStop=/usr/bin/docker stop -t 2 admiral [Install] WantedBy=default.target
systemctl enable docker-admiral.service
shutdown now -r