Skip to content

Commit 64d5313

Browse files
authored
Slim build command fix (#18)
1 parent f9ed08b commit 64d5313

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

slim-image.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ esac
4040

4141
echo "Slimming image: $SOURCE_IMAGE -> $TARGET_IMAGE (arch: $ARCH, lib: $LIB_ARCH)"
4242

43+
# 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
4344
slim build --target "$SOURCE_IMAGE" \
4445
--tag "$TARGET_IMAGE" \
4546
--http-probe=false \
4647
--continue-after=15 \
47-
--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
48+
--mount slim-pgdata:/var/lib/postgresql/data \
4849
--expose=5432 \
4950
--expose=8008 \
5051
--expose=8081 \
@@ -84,4 +85,7 @@ slim build --target "$SOURCE_IMAGE" \
8485
--include-bin=/usr/bin/id \
8586
--include-bin=/usr/bin/env
8687

88+
# delete volume to always start with an empty PGDATA directory
89+
docker volume rm slim-pgdata
90+
8791
echo "Successfully created slimmed image: $TARGET_IMAGE"

0 commit comments

Comments
 (0)