Skip to content

Commit 6b0daeb

Browse files
authored
Update Dockerfile
1 parent 66fe910 commit 6b0daeb

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

Dockerfile

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
# Use the latest Postgres Docker image based on Alpine
21
FROM postgres:16-alpine
32

4-
# Set working directory
5-
WORKDIR /usr/src/app
3+
RUN apk update && apk add git build-base postgresql-dev
4+
RUN postgres --version
5+
RUN git clone https://github.com/fboulnois/pg_uuidv7
6+
RUN cd pg_uuidv7 && make && make install && ls -la
67

7-
# Install curl
8-
RUN apk add --no-cache curl
8+
COPY ./init.sql /docker-entrypoint-initdb.d/init.sql
99

10-
RUN cd "$(mktemp -d)" \
11-
&& curl -LO "https://github.com/fboulnois/pg_uuidv7/releases/download/v1.3.0/{pg_uuidv7.tar.gz,SHA256SUMS}" \
12-
&& tar xf pg_uuidv7.tar.gz \
13-
&& sha256sum -c SHA256SUMS \
14-
&& PG_MAJOR=$(pg_config --version | sed 's/^.* \([0-9]\{1,\}\).*$/\1/') \
15-
&& cp "$PG_MAJOR/pg_uuidv7.so" "$(pg_config --pkglibdir)" \
16-
&& cp sql/pg_uuidv7--1.3.sql pg_uuidv7.control "$(pg_config --sharedir)/extension"
1710
# Add a script to run the CREATE EXTENSION command
1811
RUN printf '#!/bin/sh\npsql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE EXTENSION pg_uuidv7;"' > /docker-entrypoint-initdb.d/init.sh
1912

0 commit comments

Comments
 (0)