Minimal OS to run a containerd container
Inspired by projects like CoreOS, RancherOS, and Talos Linux, Galos is a minimal Linux OS powered by gokrazy that is primarily designed to run a single containerd container on IoT bare metal with as few executables as possible.
Note: As you probably guessed, the name 'Galos' is a nod to GoKrazy and Talos Linux (unless you're a Sidero Labs lawyer, in which case it's a tribute to the Galapagos Islands)
-
Install Vim
-
Install Go >= 1.24
-
Run
go install github.com/gokrazy/tools/cmd/gok@main
-
Create a new gokrazy instance:
gok new -
Run
gok editand add your desired container in the PackageConfig section:
"github.com/ascension-association/galos": {
"GoBuildFlags": [
"-ldflags=-X main.container=ghcr.io/apptainer/lolcow:latest"
]
}
If the container doesn't have an automatic entrypoint command or you want to run your own, use this format:
"github.com/ascension-association/galos": {
"GoBuildFlags": [
"-ldflags=-X main.container=ghcr.io/void-linux/void-musl-busybox:latest -X 'main.task=cat /etc/os-release'"
]
}
Important: the ctr command-line tool, which Galos uses, requires fully-qualified image references, including the registry domain and the tag, such as docker.io/library/nginx:latest, and cannot be abbreviated to just docker.io/library/nginx or nginx or nginx:latest.
Note: if no container is provided, Galos defaults to docker.io/library/hello-world:latest
- IF running on x86/amd64, do the following then save:
- add this line under the "Hostname" line:
"KernelPackage": "github.com/gokrazy/kernel.amd64", - change
"GOARCH=arm64"to"GOARCH=amd64"
- Add Galos and its dependencies:
gok add github.com/gokrazy/mkfs
gok add github.com/ascension-association/gk-containerd
gok add github.com/ascension-association/galos
- If deploying via USB/SD at location /dev/sda:
gok overwrite --full /dev/sdaOtherwise, if you're targeting an already deployed instance:gok update
IF deploying via USB/SD, plug into target device and boot from it. Use the URL provided in the output of the gok overwrite step to load in your source machine's browser (note: you may need to replace 'hello' with the IP address of the target device).
-
Verify it worked by going to the gokrazy dashboard, clicking on the
/user/galoslink and reviewing the logs -
Optionally, once confirmed working, edit your gokrazy config.json again and remove the
"github.com/gokrazy/hello",,"github.com/gokrazy/fbstatus",and"github.com/gokrazy/mkfs",packages (and even"github.com/gokrazy/breakglass",if you don't need SSH access), then rungok updateto further minimize the device contents