From bb42c13ffcaa69baafcfac4d5593d36d55fcad6b Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 21 Jan 2026 16:23:23 +0100 Subject: [PATCH] slim build command fixed, the commend would break the newline link Also delete the docker volume to always start with a fresh PGDATA directory --- slim-image.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/slim-image.sh b/slim-image.sh index b3909bc..b0485a2 100755 --- a/slim-image.sh +++ b/slim-image.sh @@ -40,11 +40,12 @@ esac echo "Slimming image: $SOURCE_IMAGE -> $TARGET_IMAGE (arch: $ARCH, lib: $LIB_ARCH)" +# use *--mount* volume so it starts with an empty PGDATA directory to initdb will be called and the components used for it will be perserved slim build --target "$SOURCE_IMAGE" \ --tag "$TARGET_IMAGE" \ --http-probe=false \ --continue-after=15 \ - --mount slim-pgdata:/var/lib/postgresql/data \ # mount volume so it starts with an empty PGDATA to initdb will be called and the components used for it will be perserved + --mount slim-pgdata:/var/lib/postgresql/data \ --expose=5432 \ --expose=8008 \ --expose=8081 \ @@ -84,4 +85,7 @@ slim build --target "$SOURCE_IMAGE" \ --include-bin=/usr/bin/id \ --include-bin=/usr/bin/env +# delete volume to always start with an empty PGDATA directory +docker volume rm slim-pgdata + echo "Successfully created slimmed image: $TARGET_IMAGE"