-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
71 lines (59 loc) · 1.87 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
ARG postgres_version=12
FROM postgres:$postgres_version
ENV PLV8_VERSION=2.3.14 \
PLV8_SHASUM="9bfbe6498fcc7b8554e4b7f7e48c75acef10f07cf1e992af876a71e4dbfda0a6"
ARG oracle_fdw_version=2_2_1
ARG instantclient_version=19_3
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
libaio1 \
libaio-dev \
build-essential \
make \
unzip \
postgresql-server-dev-all \
postgresql-common \
curl \
ca-certificates \
p7zip
COPY sdk\ /tmp
RUN unzip "/tmp/*.zip" -d /tmp
ENV ORACLE_HOME /tmp/instantclient_${instantclient_version}
ENV LD_LIBRARY_PATH /tmp/instantclient_${instantclient_version}
RUN cd /tmp/oracle_fdw-ORACLE_FDW_${oracle_fdw_version} && make && make install
RUN buildDependencies="build-essential \
ca-certificates \
curl \
git-core \
python \
gpp \
cpp \
pkg-config \
apt-transport-https \
cmake \
libc++-dev \
libc++abi-dev \
postgresql-server-dev-$PG_MAJOR" \
&& runtimeDependencies="libc++1 \
libtinfo5 \
libc++abi1" \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${buildDependencies} ${runtimeDependencies} \
&& mkdir -p /tmp/build \
&& curl -o /tmp/build/v$PLV8_VERSION.tar.gz -SL "https://github.com/plv8/plv8/archive/v${PLV8_VERSION}.tar.gz" \
&& cd /tmp/build \
&& echo $PLV8_SHASUM v$PLV8_VERSION.tar.gz | sha256sum -c \
&& tar -xzf /tmp/build/v$PLV8_VERSION.tar.gz -C /tmp/build/ \
&& cd /tmp/build/plv8-$PLV8_VERSION \
&& make static \
&& make install \
&& strip /usr/lib/postgresql/${PG_MAJOR}/lib/plv8-${PLV8_VERSION}.so \
&& rm -rf /root/.vpython_cipd_cache /root/.vpython-root \
&& apt-get clean \
&& apt-get remove -y ${buildDependencies} \
&& apt-get autoremove -y \
&& rm -rf /tmp/build /var/lib/apt/lists/* /tmp/*.zip
USER postgres
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 5432
CMD ["postgres"]