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.
Pre-Reqs
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
/etc/systemd/system/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
docker ps
Articles like this really grease the shafts of kngdelwoe.
how can a company that sells 500 million twinkie a year and more than 100 million loaves of bread a year (among others), still close down altogether?cant it get leaner? slash its size in half? why close entirely? i dont understand.
Could this be used to interrupt or stop a vcenter server appliance from booting up? As I understand it the VCSA 6.5 uses photonOS. Thoughts?