reduced mongo image size
Some checks failed
ci/woodpecker/push/db Pipeline failed

This commit is contained in:
Stephan D
2025-11-07 01:43:08 +01:00
parent 2954dcde7b
commit 8cea7f005b
2 changed files with 15 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ VAULT_ADDR=https://vault.sendico.io
MONGO_PORT=27017
MONGO_REPLICA_SET=sendico-rs
MONGO_AUTH_SOURCE=admin
MONGO_ARCH=linux/arm64
PBM_S3_ENDPOINT=https://s3.sendico.io
PBM_S3_REGION=eu-central-1

View File

@@ -11,6 +11,7 @@ set +a
REGISTRY_URL="${REGISTRY_URL:-}"
MONGO_VERSION="${MONGO_VERSION:-latest}"
MONGO_ARCH="${MONGO_ARCH:-linux/amd64}"
APP_V="${APP_V:-}"
if [ -z "$REGISTRY_URL" ]; then
@@ -31,12 +32,21 @@ done
CREDS="$(cat secrets/REGISTRY_USER):$(cat secrets/REGISTRY_PASS)"
skopeo copy --all \
"docker://docker.io/library/mongo:${MONGO_VERSION}" \
"docker://${REGISTRY_URL}/mirror/mongo:${APP_V}" \
SRC_REF="docker://docker.io/library/mongo:${MONGO_VERSION}"
DEST_REF="docker://${REGISTRY_URL}/mirror/mongo:${APP_V}"
OS="${MONGO_ARCH%%/*}"
ARCH="${MONGO_ARCH##*/}"
skopeo copy \
--override-os "${OS:-linux}" \
--override-arch "${ARCH:-amd64}" \
--retry-times 3 \
"$SRC_REF" \
"$DEST_REF" \
--dest-creds "$CREDS"
INSPECT="$(skopeo inspect "docker://${REGISTRY_URL}/mirror/mongo:${APP_V}" --creds "$CREDS")"
INSPECT="$(skopeo inspect "$DEST_REF" --creds "$CREDS")"
DIGEST="$(printf '%s' "$INSPECT" | tr -d '\n' | sed -n 's/.*"Digest"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')"
if [ -z "$DIGEST" ]; then