aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jails/20_immich/templates/usr_local_bin_extract_image.sh
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2026-08-13 22:18:47 +0300
committerJan Tuomi <jan@jantuomi.fi>2026-08-13 22:18:47 +0300
commit22a76436ca9acced00c517b57ae2f2b73a197de0 (patch)
tree9f849d28dbe2cb98c0d7c3505b8c0b6476985182 /roles/jails/20_immich/templates/usr_local_bin_extract_image.sh
parent40596977c2191247bd602170f6a63958c59697f7 (diff)
Update immich jail
Diffstat (limited to 'roles/jails/20_immich/templates/usr_local_bin_extract_image.sh')
-rw-r--r--roles/jails/20_immich/templates/usr_local_bin_extract_image.sh47
1 files changed, 0 insertions, 47 deletions
diff --git a/roles/jails/20_immich/templates/usr_local_bin_extract_image.sh b/roles/jails/20_immich/templates/usr_local_bin_extract_image.sh
deleted file mode 100644
index e8226dd..0000000
--- a/roles/jails/20_immich/templates/usr_local_bin_extract_image.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-# Extract a Docker image to a directory under /image/
-# Usage: extract-image.sh <image-ref> <name>
-# Example: extract-image.sh ghcr.io/immich-app/immich-server:v2.4.1 immich-server
-
-set -eu
-
-IMAGE="$1"
-NAME="$2"
-IMAGE_DIR="/image"
-TARGET="${IMAGE_DIR}/${NAME}"
-TMP_DIR="/tmp/oci-${NAME}"
-
-echo "Extracting ${IMAGE} to ${TARGET}..."
-
-# Clean up any previous extraction attempt
-rm -rf "${TMP_DIR}"
-mkdir -p "${TMP_DIR}"
-
-# Pull image layers
-skopeo copy --override-os linux "docker://${IMAGE}" "dir:${TMP_DIR}"
-
-# Extract all layers in order into new rootfs
-rm -rf "${TARGET}.new"
-mkdir -p "${TARGET}.new"
-
-# Parse layer digests from manifest and extract each layer
-grep -o '"sha256:[a-f0-9]*"' "${TMP_DIR}/manifest.json" | \
- sed 's/"//g; s/sha256://' | \
- while read hash; do
- if [ -f "${TMP_DIR}/${hash}" ]; then
- echo " Extracting layer ${hash}..."
- tar -xzf "${TMP_DIR}/${hash}" -C "${TARGET}.new" 2>/dev/null || \
- tar -xf "${TMP_DIR}/${hash}" -C "${TARGET}.new" 2>/dev/null || true
- fi
- done
-
-# Swap in the new rootfs
-if [ -d "${TARGET}" ]; then
- mv "${TARGET}" "${TARGET}.old"
-fi
-mv "${TARGET}.new" "${TARGET}"
-
-# Cleanup
-rm -rf "${TMP_DIR}" "${TARGET}.old"
-
-echo "Done: ${TARGET}"