Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for generating Alpine Linux images #41

Open
jonhoo opened this issue Jul 18, 2017 · 10 comments
Open

Add support for generating Alpine Linux images #41

jonhoo opened this issue Jul 18, 2017 · 10 comments

Comments

@jonhoo
Copy link

jonhoo commented Jul 18, 2017

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.

@jonhoo
Copy link
Author

jonhoo commented Jul 18, 2017

The Alpine Docker image may provide some useful insights too.

@hartwork
Copy link
Owner

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?

@jonhoo
Copy link
Author

jonhoo commented Jul 18, 2017

Not that I know of — we'd likely have to implement a chroot procedure similar to the one used for Arch

@hartwork
Copy link
Owner

hartwork commented Jul 18, 2017

Can you take over the research on what's needed in detail?

@jonhoo
Copy link
Author

jonhoo commented Jul 18, 2017

I'll take a look and report back.

@jonhoo
Copy link
Author

jonhoo commented Jul 18, 2017

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.

@hartwork
Copy link
Owner

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?

@jonhoo
Copy link
Author

jonhoo commented Jul 19, 2017

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.

@ghost
Copy link

ghost commented Dec 27, 2017

@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.

@hartwork
Copy link
Owner

hartwork commented Mar 29, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants