Skip to content

Instantly share code, notes, and snippets.

@cgwalters
Created September 10, 2021 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgwalters/bdbc8fddde21fd008e9ca478c30bc03a to your computer and use it in GitHub Desktop.
Save cgwalters/bdbc8fddde21fd008e9ca478c30bc03a to your computer and use it in GitHub Desktop.
generating derived rpm-ostree ex containers
[root@cosa-devsh ~]# rpm-ostree status -b
State: idle
Deployments:
* fedora:fedora/x86_64/coreos/testing-devel
                   Version: 34.20210907.dev.0 (2021-09-07T12:41:33Z)
                    Commit: be12912a5530514fbf2ce8e8eeb52688b447345dc2c1c91fc609a7147b34cde0
              GPGSignature: (unsigned)
[root@cosa-devsh ~]# rpm-ostree install cowsay
...
Added:
  cowsay-3.04-17.fc34.noarch
...
Changes queued for next boot. Run "systemctl reboot" to start a reboot
[root@cosa-devsh ~]# pending=$(rpm-ostree status --json | jq -r .deployments[0].checksum)
[root@cosa-devsh ~]# echo $pending
8028c75a9ba70a9216da819285715c6981d268a1b0a9785a50329f9e0f95540a

Now, for this next part, ensure you have ~/.docker/config.json.

[root@cosa-devsh ~]# rpm-ostree ex-container export --repo=/sysroot/ostree/repo $pending docker://quay.io/myuser/fcos-with-cowsay
docker://quay.io/myuser/fcos-with-cowsay@sha256:6c3c9ec540a2ccc922afc8abf508213f773c00204ed70a02e9fdc3d9ae55564c
[root@cosa-devsh ~]#

And then on another system, you can just do:

[root@cosa-devsh ~]# rpm-ostree rebase docker://quay.io/myuser/fcos-with-cowsay:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment