JasonN3 / build-container-installer

Creates an ISO for installing a container image as an OS
GNU General Public License v3.0
64 stars 9 forks source link

feat: Allow building from an oci-archive tarball #120

Closed gmpinder closed 5 months ago

gmpinder commented 5 months ago

Hi! I'm the author of the BlueBuild CLI and I'm currently working on a subcommand to build ISO's locally on a user's machine. We're basically just running your image locally to create the ISO. I had the idea to allow building an ISO from an oci-archive tarball so that our users can just build their image to a local tarball and create the ISO so that they wouldn't have to publish their custom image to a registry to do so. Let me know if there's other things you need me to do to get this accepted.

JasonN3 commented 5 months ago

119 needs to adjust the transport as well. Instead of having to have conditions for each transport, would #121 work for you? It allows you to override the source portion of the skopeo copy command to whatever you want using IMAGE_SRC. This should allow you to reference local images if you want.

Also, IMAGE_REPO should still be defined for future upgrades. As far as I know of rpm-ostree needs to reference a remote registry. I'm not sure how you're planning on getting around that.

gmpinder commented 5 months ago

119 needs to adjust the transport as well. Instead of having to have conditions for each transport, would #121 work for you? It allows you to override the source portion of the skopeo copy command to whatever you want using IMAGE_SRC. This should allow you to reference local images if you want.

Oh cool, I can take a look at that later.

Also, IMAGE_REPO should still be defined for future upgrades. As far as I know of rpm-ostree needs to reference a remote registry. I'm not sure how you're planning on getting around that.

It's capable of booting from a local tarball as well. Our tool already makes use of this feature https://github.com/blue-build/cli/blob/main/src%2Fcommands%2Fswitch.rs#L126-L129

rpm-ostree rebase ostree-unverified-image:oci-archive:/path/to/tarball.tar.gz

The important thing is that it needs to be present in a local persisted directory. We make use of /etc for this purpose.

JasonN3 commented 5 months ago

Also, IMAGE_REPO should still be defined for future upgrades. As far as I know of rpm-ostree needs to reference a remote registry. I'm not sure how you're planning on getting around that.

It's capable of booting from a local tarball as well. Our tool already makes use of this feature https://github.com/blue-build/cli/blob/main/src%2Fcommands%2Fswitch.rs#L126-L129

rpm-ostree rebase ostree-unverified-image:oci-archive:/path/to/tarball.tar.gz

The important thing is that it needs to be present in a local persisted directory. We make use of /etc for this purpose.

Good to know. What is your plan for when people need to update their system? Are you going to have them update the local files and rebase every time or just rebase once and then update the files? I'm just trying to figure out if it's worth expanding this to also change lorax_templates/scripts/post/install_configure_upgrades to automatically change the target when it gets installed.

gmpinder commented 5 months ago

119 needs to adjust the transport as well. Instead of having to have conditions for each transport, would #121 work for you? It allows you to override the source portion of the skopeo copy command to whatever you want using IMAGE_SRC. This should allow you to reference local images if you want.

Ok so looking at this PR, I think this would be perfect for loading from a tarball.

Good to know. What is your plan for when people need to update their system? Are you going to have them update the local files and rebase every time or just rebase once and then update the files? I'm just trying to figure out if it's worth expanding this to also change lorax_templates/scripts/post/install_configure_upgrades to automatically change the target when it gets installed.

So I'm not entirely sure for other users of your project, but for BlueBuild, we ship our CLI with every image that's built using it so our users would be able to just use our bluebuild switch command and it will manage building the image and booting from it using rpm-ostree (bootc support in the future).

JasonN3 commented 5 months ago

119 needs to adjust the transport as well. Instead of having to have conditions for each transport, would #121 work for you? It allows you to override the source portion of the skopeo copy command to whatever you want using IMAGE_SRC. This should allow you to reference local images if you want.

Ok so looking at this PR, I think this would be perfect for loading from a tarball.

Good to know. What is your plan for when people need to update their system? Are you going to have them update the local files and rebase every time or just rebase once and then update the files? I'm just trying to figure out if it's worth expanding this to also change lorax_templates/scripts/post/install_configure_upgrades to automatically change the target when it gets installed.

So I'm not entirely sure for other users of your project, but for BlueBuild, we ship our CLI with every image that's built using it so our users would be able to just use our bluebuild switch command and it will manage building the image and booting from it using rpm-ostree (bootc support in the future).

Everyone else that I know of is using a repo, so they're able to just update based on the repo. If you have a working process, then no need to over-complicate it. I'm going to close this as a duplicate since #121 resolves the issue.