Skip to content

Commit 85042bd

Browse files
authored
Make image more resilient (#13)
Avoid 'psql:/docker-entrypoint-initdb.d/create-extension.sql:1: ERROR: extension "debversion" already exists' error if restoring form dump file that also creates the extension
1 parent f7c286e commit 85042bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ ARG base=docker.io/library/postgres:17-bookworm
22
FROM $base
33

44
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends postgresql-17-debversion && \
5-
echo 'CREATE EXTENSION debversion' > /docker-entrypoint-initdb.d/create-extension.sql
5+
echo 'CREATE EXTENSION IF NOT EXISTS debversion WITH SCHEMA public;' > /docker-entrypoint-initdb.d/create-extension.sql
66

77
ADD postgresql.conf /etc/postgresql/

0 commit comments

Comments
 (0)