image-bootstrap
                                
                                 image-bootstrap copied to clipboard
                                
                                    image-bootstrap copied to clipboard
                            
                            
                            
                        Add support for generating Alpine Linux images
It'd be really near if image-bootstrap also supported generating images for Alpine Linux, as it is a distro that is specifically designed to be small and secure (and therefore fits well as a cloud image). They also have cloud-init available as a package.
What would be the changes necessary to add another distro to image-bootstrap? I might be able to contribute some time to this if I'm pointed in the right direction.
The Alpine Docker image may provide some useful insights too.
Hi Jon,
a key question is if Alpine has some equivalent to debootstrap/directory-bootstrap already or if that part needs to be made as well. Do they have a tool for Alpine chroot creation?
Not that I know of — we'd likely have to implement a chroot procedure similar to the one used for Arch
Can you take over the research on what's needed in detail?
I'll take a look and report back.
Ah, interesting... So, looking at the Docker mkimage-alpine, Alpine Linux provides a statically linked binary of their package manager that can bootstrap the system. It's fetched here and invoked here. This procedure is documented in the official Alpine wiki. There is even an official alpine-chroot-install script that may be of use. My guess is that we can also use parts of the included setup-alpine script to finalize setup.
Hi!
Some of these options look good, for some I have concerns:
- Moby/mkimage-alpine.sh is by Moby, not by Alpine itself. I would expect the user to trust alpine code if he/she wants to bootstrap Alpine but nothing else, so not Moby (even if they're the best)
- Installing Alpine Linux in a chroot looks excellent
- alpine-chroot-install may do modifications to the host system, e.g. installing packages. If you search for "host", you find plenty. I'm not sure if that's cool for something to download and execute. On the other hand, if that exists maybe there is no point in duplicating all of that.
What do you think?
Looking through the alpine-chroot-install script, it seems like all it's really doing is installing QEMU (which is the only reason it modifies the host afaict) and then following the "installing Alpine Linux in a chroot" wiki entry, so I think just following those steps is the way to go.
@jonhoo The alpine-chroot-install script is not strictly necessary. The qemu installation is for cross-architecture installs, which is not intended to be implemented for now.
Quick update regarding directory-bootstrap: Basic support for Alpine Linux just arrived. It downloads the latest mini chroot tarball, verifies its signature, and extracts the tarball.