Skip to content

Commit 60dcfe8

Browse files
committed
HHH-20009 Fix docker_db.sh for Apple Silicon & fix env var typo in postgresql_18
- Added --platform linux/amd64 to postgresql_17 and postgresql_18 functions for macOS environment. The current postgis images lack ARM64 manifests, requiring amd64 emulation via Rosetta 2. - Fixed a typo in postgresql_18 function referencing the wrong environment variable (_17 -> _18). Signed-off-by: namucy <wkdcjfdud13@gmail.com>
1 parent af5e540 commit 60dcfe8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docker_db.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,16 +255,24 @@ postgresql_16() {
255255
}
256256

257257
postgresql_17() {
258+
local platform_opts=""
259+
if [[ "$IS_OSX" == "true" ]]; then
260+
platform_opts="--platform linux/amd64"
261+
fi
258262
$CONTAINER_CLI rm -f postgres || true
259-
$CONTAINER_CLI run --name postgres -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p5432:5432 --tmpfs /var/lib/postgresql/data -d ${DB_IMAGE_POSTGRESQL_17:-docker.io/postgis/postgis:17-3.5} \
263+
$CONTAINER_CLI run --name postgres ${platform_opts} -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p5432:5432 --tmpfs /var/lib/postgresql/data -d ${DB_IMAGE_POSTGRESQL_17:-docker.io/postgis/postgis:17-3.5} \
260264
-c fsync=off -c synchronous_commit=off -c full_page_writes=off -c shared_buffers=256MB -c maintenance_work_mem=256MB -c max_wal_size=1GB -c checkpoint_timeout=1d
261265
$CONTAINER_CLI exec postgres bash -c '/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y && apt install -y postgresql-17-pgvector'
262266
postgresql_setup
263267
}
264268

265269
postgresql_18() {
270+
local platform_opts=""
271+
if [[ "$IS_OSX" == "true" ]]; then
272+
platform_opts="--platform linux/amd64"
273+
fi
266274
$CONTAINER_CLI rm -f postgres || true
267-
$CONTAINER_CLI run --name postgres -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p5432:5432 --tmpfs /var/lib/postgresql -d ${DB_IMAGE_POSTGRESQL_17:-docker.io/postgis/postgis:18-3.6} \
275+
$CONTAINER_CLI run --name postgres ${platform_opts} -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p5432:5432 --tmpfs /var/lib/postgresql -d ${DB_IMAGE_POSTGRESQL_18:-docker.io/postgis/postgis:18-3.6} \
268276
-c fsync=off -c synchronous_commit=off -c full_page_writes=off -c shared_buffers=256MB -c maintenance_work_mem=256MB -c max_wal_size=1GB -c checkpoint_timeout=1d
269277
$CONTAINER_CLI exec postgres bash -c '/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y && apt install -y postgresql-18-pgvector'
270278
postgresql_setup

0 commit comments

Comments
 (0)