-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathpostgres_mssql.docker
42 lines (34 loc) · 1.14 KB
/
postgres_mssql.docker
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
ARG base_tag=16.3
FROM postgres:${base_tag}
ARG pg_version=16
ARG fdw_version=2.0.3
# TDS_FDW didn't release a new version supporting postgres 16.
# hence, we use the master branch
#ARG fdw_url=https://github.com/tds-fdw/tds_fdw/archive/v${fdw_version}.zip
ARG fdw_url=https://github.com/tds-fdw/tds_fdw/archive/refs/heads/master.zip
ARG source_files=/tmp/tds_fdw
#ARG source_root=tds_fdw-REL-2_0_3
ARG source_root=tds_fdw-master
RUN apt-get update;
# compilation deps
RUN apt-get install -y --no-install-recommends wget unzip ca-certificates \
make gcc gnupg \
postgresql-server-dev-${pg_version} freetds-dev \
# runtime deps
libsybdb5 freetds-common; \
# tds_fdw
rm -rf ${source_files}; \
mkdir -p ${source_files}; \
wget -O sources.zip ${fdw_url}; \
unzip sources.zip -d ${source_files}; \
rm sources.zip; \
cd ${source_files}/${source_root}; \
# install
make USE_PGXS=1; \
make USE_PGXS=1 install; \
# cleanup
apt-get purge -y --auto-remove wget unzip ca-certificates \
make gcc gnupg \
postgresql-server-dev-${pg_version} freetds-dev; \
cd -; \
rm -rf ${source_files};