Use ko to build the container image#7
Conversation
|
We're intending to make it use https://github.com/tailscale/mkctr, which we use for other services. |
|
Aren't we only using mkctr because ko didn't do something @maisem? Maybe ko does now? |
Oh awesome! The repo says:
which, it's true, I'd be curious to learn more about that use case though, I've truly never really needed multiple binaries in the same image, vs multiple single-binary containers in a Pod. |
The official tailscale container requires multiple binaries, If |
This PR proposes using
koto build the container image, instead ofdocker build.kogenerates an SBOM and attaches it to the image, seecosign download sbom ghcr.io/imjasonh/golinkkodoesn't require you to maintain a Dockerfile, justko buildand get an image.kodoesn't require any container runtime to build. Sincego buildis assumed not to have deleterious side effects, there's no real benefit to running it in a container; you can stop running Docker on your development machine.kosupports multi-platform builds easily. Add--platform=linux/amd64,linux/arm64, or just--platform=all, to build for all platforms supported by your base image (currently 8 platforms).kobuilds images more reproducibly thandocker build, which can lead to faster rebuilds and less registry storage.This also changes the image to not set the
--sqlitedbor--verboseflags by default anymore, and instead only recommend them at (production-)runtime.I've built this in my fork, see the Action run here: https://github.com/imjasonh/golink/actions/runs/3462861488, and the image it produced at
ghcr.io/imjasonh/golink.