Running Docker

Mesh Hypervisor nodes can run Docker containers bare-metal—great for lightweight services like a web server or app. This guide shows how to enable Docker on a remote node and spin up a test container. Commands run via SSH to the central orchestration node’s CLI (e.g., ssh root@<central-ip>). For node setup, see Configuring Nodes.

Prerequisites

Ensure:

  • A remote node is online (mesh node info).
  • You’ve got a machine folder (e.g., /host0/machines/docker-node/).
  • The docker group exists in /host0/groups/docker/—it’s prebuilt with Docker tools.

Step 1: Enable Docker

  1. Add Docker Group: In /host0/machines/docker-node/groups:
    baseline
    docker
    
    • baseline sets essentials; docker installs Docker and tweaks services.
  2. Set UUID: In /host0/machines/docker-node/UUID, use the node’s UUID (e.g., 10eff964) from mesh node info.
  3. Apply: Update the mirror, rebuild, and reboot:
    mesh system download
    mesh system configure
    mesh node ctl -n 10eff964 "reboot"
    
    • mesh system download grabs docker packages; docker group adds them to /etc/apk/world.

Step 2: Run a Test Container

  1. SSH In: Connect to the node:
    mesh node ctl -n 10eff964
    
  2. Verify Docker: Check it’s running:
    docker version
    
    • Should show Docker client and server versions—services auto-start via the group.
  3. Pull an Image: Grab a simple container:
    docker pull hello-world
    
    • Downloads the hello-world image from Docker Hub.
  4. Run It: Start the container:
    docker run hello-world
    
    • Prints a “Hello from Docker!” message and exits—proof it works.
  5. Exit Node: Back to the central node:
    Ctrl+D
    

Notes

The docker group handles everything: installs docker, docker-openrc, etc., links services to /etc/runlevels/default/, and sets rc_cgroup_mode=unified in /etc/rc.conf for cgroups. No manual CLI tweaks needed—just add the group and go. For persistent containers, add a manifest entry (e.g., O MODE=root:root:0644 SRC=/host0/machines/docker-node/run.sh TGT=/usr/local/bin/run.sh) and script your docker run. See Managing Nodes for CLI tips; Configuring Nodes for group details.

Next, explore Configuring Samba.