coreos / fedora-coreos-tracker

Issue tracker for Fedora CoreOS
https://fedoraproject.org/coreos/
262 stars 59 forks source link

docs: mention coreos-assembler and show how to rebuild an FCOS image #319

Open vroad opened 4 years ago

vroad commented 4 years ago

Can I build custom Fedora CoreOS AMI by myself? I just want to add some docker images to the AMI to make initialization process faster. I hope that there is an official way to build AMI with my docker images included.

Even though I could use something like packer to build Custom AMI based on official one, it's probably not an officially supported way, and has some issues. Since it just takes snapshot of root volume by launching AMI on AWS, it leaves lots of traces like log files, and a file that marks ignition as already run (so that ignition won't run twice). If you don't disable auto update service, it will start downloading updates as well. To make ignition run more than once, I could remove ignition status flle, but that sounds like a hack. I'm not sure if there is a better way than this.

cgwalters commented 4 years ago

Our build tool is https://github.com/coreos/coreos-assembler/ That said today it doesn't directly support what you want for a few reasons; mainly that we haven't needed the feature, but secondarily that at least for FCOS, there's separate storage for docker and podman, and so pre-loading any images opens up the can of worms around whether we do both, just one, etc.

jlebon commented 4 years ago

One hack is to just do add-files in the manifest to bake in the image blobs and have a firstboot systemd service that loads them into your desired container runtime.

lucab commented 4 years ago

Leaving the specific use-case out of scope for a moment, I think there is a a legit point on augmenting FCOS docs to briefly cover coreos-assembler. ContainerLinux had a similar doc-page, see https://coreos.com/os/docs/latest/sdk-modifying-coreos.html. The goal is not to cover all of coreos-assembler options, but to jump-start and provide a concise answer to "how can I build an FCOS image?".