Skip to content

Commit 273307b

Browse files
committed
Share host image store with nested podman in tests
Mount the host's podman graph root as a read-only additional image store inside the nested container. The inner podman sees all host images instantly without network pulls. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3791fc6 commit 273307b

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

hack/test-container-image.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,25 @@ run_test() {
3838
;;
3939
nested)
4040
nested_container="bink-nested-${cluster_name}"
41+
HOST_GRAPH_ROOT=$(podman info --format '{{.Store.GraphRoot}}')
42+
storage_conf=$(mktemp)
43+
cat > "${storage_conf}" <<'STOREOF'
44+
[storage]
45+
driver = "overlay"
46+
[storage.options]
47+
additionalimagestores = ["/host-store"]
48+
STOREOF
4149
echo "Starting bink daemon container: ${nested_container}"
50+
echo " Sharing host image store from ${HOST_GRAPH_ROOT}"
4251
podman run -d --name "${nested_container}" --privileged \
4352
--device /dev/kvm \
4453
--ulimit core=-1:-1 \
4554
-v "bink-test-storage:/var/lib/containers" \
55+
-v "${HOST_GRAPH_ROOT}:/host-store:ro" \
56+
-v "${storage_conf}:/etc/containers/storage.conf:ro" \
4657
-v "$(pwd):/output" \
4758
"${BINK_IMAGE}"
59+
rm -f "${storage_conf}"
4860
echo "Waiting for podman service inside container..."
4961
for _ in $(seq 1 30); do
5062
if podman exec "${nested_container}" podman info &>/dev/null; then
@@ -56,6 +68,8 @@ run_test() {
5668
# unreachable from inside nested podman networks. Override it so inner aardvark-dns
5769
# forwards queries to a public resolver instead.
5870
podman exec "${nested_container}" bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
71+
echo "Images available in nested podman:"
72+
podman exec "${nested_container}" podman images --format "table {{.Repository}}:{{.Tag}}\t{{.Size}}"
5973
bink_args=(podman exec "${nested_container}" bink)
6074
;;
6175
*)

0 commit comments

Comments
 (0)