-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
36 lines (28 loc) · 1.25 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM postgres:13 AS builder
RUN set -ex \
&& apt-get update \
&& apt-get install -y build-essential libssl-dev postgresql-server-dev-13 jq \
&& mkdir -p /usr/src/pg_diffix
WORKDIR /usr/src/pg_diffix
COPY . .
RUN make TARGET="release" && make install
FROM postgres:13 as pg_diffix
# Hint that session_preload_libraries should have 'pg_diffix'.
# This will get copied to the default config on initialization.
#
# Users can (and likely will) provide custom configuration files,
# in which case they need to be aware that this parameter is required
# for the extension to function properly.
RUN sed -i \
"/session_preload_libraries/c\session_preload_libraries = 'pg_diffix'" \
/usr/share/postgresql/postgresql.conf.sample
# Runs CREATE EXTENSION in POSTGRES_DB.
COPY docker/0* /docker-entrypoint-initdb.d/
# Copy artifacts from builder.
# If LLVM is enabled, there will be other files that need to be copied.
COPY --from=builder /usr/lib/postgresql/13/lib/pg_diffix.so /usr/lib/postgresql/13/lib/pg_diffix.so
COPY --from=builder /usr/share/postgresql/13/extension/pg_diffix* /usr/share/postgresql/13/extension/
FROM pg_diffix as pg_diffix_demo
# Copy dataset SQL files.
COPY docker/1* /docker-entrypoint-initdb.d/
COPY docker/demo /docker-entrypoint-initdb.d/demo