I’m using a custom manifest.yaml to build a coreos image to install on several servers. Originally I was uploading the .ociarchive file to each server individually by hand, but that scales poorly (my upload bandwidth isn’t great). Now, I’m trying to use a docker registry, but I can’t find an rpm-ostree equivalent to podman pull that actually works.
rpm-ostree rebase ostree-unverified-registry:example.com/my-image:latest
works fine exactly once: the system happily rebases and reboots, and then can never be upgraded. Subsequent attempts at the same command yield
error: Old and new refs are equal: ostree-unverified-registry:example.com/my-image:latest
The alternate form ostree-unverified-image:docker://example.com/my-image:latest does the same thing: rpm-ostree rebase will rebase on it exactly once and then never again. I can’t find anything in rpm-ostree that looks like a “pull” command.
One level lower, ostree does have ostree container image pull, but trying that yields a (predictable) error about the filesystem being read-only:
# ostree container image pull /sysroot/ostree/repo ostree-unverified-image:docker://example.com/my-image:latest
error: Preparing import: Fetching manifest: Writing cached pending manifest: Unable to write detached metadata: open(O_TMPFILE): Read-only file system
I’ve found I can work around this by generating a docker URL in the image@sha syntax using skopeo inspect so that the string passed into rpm-ostree is always unique:
# this works
rpm-ostree rebase ostree-unverified-image:docker://"$( \
skopeo inspect "docker://example.com/my-image:latest" \
| jq -r '.Name + "@" + .Digest' )"
but it seems like this is a lot more difficult than it should be. I suspect I’m missing something obvious. Am I supposed to mount -o rw,remount /sysroot to use ostree container image pull? Or is this just a missing feature?