User Tools

Site Tools


esxi:docker_host

This is an old revision of the document!


Table of Contents

Docker Host

Setup

Setup Docker on Photon OS on ESXi, and install Portainer and Unifi Controller.

  • Download the Photon OS OVA with virtual hardware v13 from https://github.com/vmware/photon/wiki/Downloading-Photon-OS
  • In ESXi:
    • Create/Register VM
    • Deploy a virtual machine from an OVF or OVA file
    • Name the VM
    • Upload the Photon OS OVA file
    • Specify the desired Target Datastore
    • Accept the License Agreement
    • Select Deployment Options
    • Confirm settings
    • Actions > Edit Settings
    • Select appropriate VM settings depending on desired applications
    • Use NVMe Controller for the hard disk if using NVMe storage
    • Set desired autostart setting
    • Run VM
    • Login with root details from the VM note
    • Set new password
    • Disable password expiry: chage -M -1 root
    • Set new hostname: hostnamectl set-hostname <hostname>
    • Update packages: tdnf upgrade
    • Enable Docker to run at startup: systemctl enable docker
    • Shutdown, Save Initial snapshot, and start the VM again
    • Install Portainer:
      • docker volume create portainer_data
      • docker run –name Portainer –restart=always -d -p 8000:8000 -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
  • Shutdown, Save Configured snapshot, and start the VM again
  • Edit VM note to indicate details/running applications, e.g.:
Minimal installed profile of PhotonOS
User: root

Docker host:
Portainer:
8000/TCP, 9000/TCP http Web Interface
http://<server.example.com>:9000
User: <User>

Unifi Controller:
10001/udp, 3478/udp
6789/tcp, 8080/tcp
8443/tcp https Web Portal
8843/tcp, 8880/tcp
https://<server.example.com>:8443
User: <User>
  • FIXME: Add network mounts

Update

  • If desired, Log in to ESXi, navigate to the docker VM and create new snapshot
  • Connect via ssh as root to the VM and run the following:
# Update packages:
tdnf upgrade
tdnf clean all
systemctl enable docker  # For some reason I needed to re-enable docker starting on boot?
reboot  # And reconnect

# Update Portainer:
docker pull portainer/portainer
# If it responds with the following:
# Status: Downloaded newer image for portainer/portainer:latest
# then run the following to update the container
docker stop Portainer
docker rm Portainer
docker run --name Portainer --restart=always -d -p 8000:8000 -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
esxi/docker_host.1586944985.txt.gz · Last modified: 2024/09/22 19:51 (external edit)