CoreOS: Rebase on initilization

For CoreOS, is there a deployment pattern that enables me to deploy on AWS with a custom image for ostree-native-containers? Ideally, I am hoping for a method via Ignition/Butane that provides something akin to a “rpm-ostree rebase”.

Alternatively, I suspect I could use COSA or manage AMIs, but I was hoping for a simpler streamlined approach.

  • Is there a method to initialize CoreOS AWS AMI with a custom ostree-native-container via Ignition?
  • If a streamlined approach does not already exist with something like Ignition, then is there a “recommended” approach to this?
  • If there are not existing “recommended” approaches for this challenge, is there a ticket that is already discussing possible patterns for future development?

This is still work in progress. A draft documentation is available in this PR: Add a doc for container provisioning and updates by cgwalters · Pull Request #540 · coreos/fedora-coreos-docs · GitHub

Got it. From your link, it looks like the (soon to be) documented approach is Butane/Ignition with a systemd unit. Thank you!

variant: fcos
version: 1.4.0
systemd:
  units:
    # Our custom unit for rebasing
    - name: rebase-custom.service
      enabled: true
      contents: |
        [Unit]
        Description=Fetch and deploy target image
        # Only run on the firstboot
        ConditionFirstBoot=true
        After=network-online.target
        [Service]
        # This ordering is important
        After=ignition-firstboot-complete.service
        Type=oneshot
        RemainAfterExit=yes
        ExecStart=rpm-ostree rebase --reboot ostree-unverified-registry:quay.io/example/example-derived:latest
        [Install]
        WantedBy=multi-user.target

I wouldn’t consider it the final solution. This is a temporary setup/workaround.

Good to know. It would feel more like a core feature of CoreOS if there was a direct interface exposed in ignition that triggered the “rebase” during the host initialization process.