Skip to content

Commit 5436124

Browse files
committed
osbuild: leverage local container-storage when possible
In the case where we built the container inside the supermin VM then the container is available in the container-storage inside the supermin VM already so let's use the org.osbuild.containers-storage input type here for that.
1 parent c2081dd commit 5436124

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/cmd-osbuild

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ cloud-image-size: "${cloud_image_size_mb}"
229229
# Note: this is only used in the secex case; there, the rootfs is
230230
# not the last partition on the disk so we need to explicitly size it
231231
rootfs-size: "${rootfs_size_mb}"
232+
# "localhost/${name}:${build}" was the default name:tag used by cmd-build-with-buildah
233+
container-repo: "localhost/${name}"
234+
container-tag: "${build}"
232235
EOF
233236
}
234237

src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pipelines:
139139
type: org.osbuild.container-deploy
140140
inputs:
141141
images:
142-
type: org.osbuild.containers
142+
type: org.osbuild.containers-storage
143143
origin: org.osbuild.source
144144
mpp-resolve-images:
145145
images:
@@ -227,7 +227,7 @@ pipelines:
227227
- mpp-format-string: '{extra_kargs}'
228228
inputs:
229229
images:
230-
type: org.osbuild.containers
230+
type: org.osbuild.containers-storage
231231
origin: org.osbuild.source
232232
mpp-resolve-images:
233233
images:

src/runvm-osbuild

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ container_repo=$(getconfig_def "container-repo" "")
7272
container_tag=$(getconfig_def "container-tag" "")
7373
extra_kargs=$(getconfig "extra-kargs-string" "")
7474

75+
# Since the underlying osbuild manifests will prefer the ociarchive
76+
# if it exists then let's check here to see if the container exists
77+
# in local container storage. If it does then we'll just pass that
78+
# and not pass any ociarchive info into the build.
79+
if podman image exists "${container_repo}:${container_tag}"; then
80+
ostree_container=""
81+
fi
82+
7583
# Since it doesn't exist create loop-control
7684
[ ! -e /dev/loop-control ] && mknod /dev/loop-control c 10 237
7785

0 commit comments

Comments
 (0)