kairos-io / kairos

The immutable Linux meta-distribution for edge Kubernetes.
https://kairos.io
Apache License 2.0
1.17k stars 96 forks source link

Make osbuilder-controller build BYOI #1546

Open jimmykarily opened 1 year ago

jimmykarily commented 1 year ago

Currently, osbuilder needs the user to provide an image prepared for kairos. e.g. like those we build with Earthly targets: https://github.com/kairos-io/kairos/blob/dbacc56fbd7776767ebbd1c08e9bc1a045c8a9fc/Earthfile#L539

This mean, a user that wants to create a new flavor, needs to take the base OS image (upstream), apply various changes and then feed it to osbuilder.

We would like to have a better (and easier) way to build kairos images out of upstream OS images.

Desired UX

Limitations

Why

jimmykarily commented 1 year ago

Tip:

kaniko can produce tarballed docker images:

docker run -v $PWD:/workspace  -it gcr.io/kaniko-project/executor:latest --dockerfile=/workspace/Dockerfile --context=dir://workspace --destination=jimmykarily/test-kaniko --tar-path=/workspace/myimage.tar --no-push
mudler commented 1 year ago

luet code that does unpack: https://github.com/mudler/luet/blob/13dde527b4be2733c34a999d12d3b5676cc583b1/pkg/helpers/docker/docker.go#L161

nano2007 commented 1 year ago

+1 (so i get notifications :))

jimmykarily commented 1 year ago

The draft PR can now build a basic Dockerfile using kaniko. According to the plan (see image below), the next step would be to hand over to auroraboot, to convert the image to a Kairos image.

image
jimmykarily commented 1 year ago

Created this story to implement tha "convert to kairos" part: https://github.com/kairos-io/kairos/issues/1721

jimmykarily commented 3 months ago

Worth checking: https://github.com/shipwright-io/build (just a note to remember)