Open bastelfreak opened 8 years ago
what about some systemd-nspawn magic + debootstrap/yum?
the normal approach would be to setup a virtual machine, install a minimal OS by hand, boot it into the rescue, tar that stuff together, create gpg sigs and you are done. This could somehow be automated with virt-install / cloudinit.
also it needs to be discussed if it is necessary to automate the complete build process or only a update/rebuild process.
Does anybody likes pain and wants tests in serverspec for images?
Maybe we want to take a look at the Hashicorp Toolstack, they recently created Packer
nspawn is a rather bad idea if you want to build real (virtual) machines which will have there own (virtual) hardware. If you want to pre-populate a directory with packages you don't need nspawn neither. With (pac|deboot)strap and yum/dnf you can install where you want and place your config file in it. Just need to package it afterwards and sign it.
@killermoehre recommended https://de.opensuse.org/Portal:KIWI on the IRC
Perhaps it would be a good start to document first what an image for installimage actually needs to contain and how the process of building an image without using the distribution installer would look like. Would something like.
be sufficient? Are there any packages or services that have to be installed, others that are recommended for convenience that are not included in the minimal installation created by the distribution specific utilities?
- bind mount the usual dirs (/dev, /proc, /sys)
- chroot into the bootstraped system
…
- Exit chroot and umount bind-mounted dirs
@heg-hpo the arch-install-scripts should cover this very nice.
@heg-hpo ntp and ssh have to be installed, thats all.
using nspawn instead of chroot is the prefered way for everything that runs on systemd. The installimage already has functions to set that up.
@bastelfreak how do you want to configure the file system layout for this images? Doing everything on one (virtual) disk with one partition is easy. I see the problems with different partition layouts. At install time at least »/«, »/var« and »/usr« have to be available (providing /usr via shared storage is somehow common in virtualised environments, a /var on nfs helps to keep things central).
there isn't any need to have multiple partitions for creating an image.
There is a need to put them in the /etc/fstab
.
we don't have to do that while building the image. installimage will rewrite the fstab.
So, if we use LARS as base build platform for abriatary distributions, than it should be quite easy.
systemd-run -M
or machinectl shell
) OR bind mount the already downloaded packages in the package cachesystemd-run -M
or machinectl shell
)and then wrap all in jenkins to have CD and (kind of) reproducible builds.
can we please do something awesome here? building images with FPM? with nspawn? @killermoehre @bluewind your opinions?