-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
104 lines (92 loc) · 3.32 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
ARG PG_MAJOR=16
FROM postgres:12.22-alpine@sha256:c1f99fc1f0e8e53203979bdc415d58fb09755f8edba8ea257f7fb6eca1b53d63 AS pg12
FROM postgres:13.18-alpine@sha256:ff1031198923533ea248818bc23c5bd2c9fcb99de37f859e66ed0fdb1d92389b AS pg13
FROM postgres:14.15-alpine@sha256:33cffe13f1a9661a69115198b1b9106762a5d3c9bef0df3f4f232694e76e47e7 AS pg14
FROM postgres:15.10-alpine@sha256:81ad63b0fb813bbd2752c6722b649c13d6a0ea740db31e35c6e366d163cefb59 AS pg15
FROM postgres:16.6-alpine@sha256:7485c117bff85f9c9a2d9f407de7fe6d0485e4c5043adb53dd276cb166940b44 AS pg16
# patched pg14 with security_invoker for views
FROM technowledgy/postgres:14-alpine@sha256:d5f27c97d30918476aaa8d962be34169ae645625f2ecb74d87f3251b68af27bd AS pg14-invoker
# hadolint ignore=DL3006
FROM pg${PG_MAJOR} AS base
LABEL org.opencontainers.image.authors Wolfgang Walther
LABEL org.opencontainers.image.source https://github.com/technowledgy/pg_dev
LABEL org.opencontainers.image.licences MIT
WORKDIR /usr/src
SHELL ["/bin/sh", "-eux", "-c"]
COPY tools /usr/local/bin
COPY initdb /docker-entrypoint-initdb.d
COPY ext /usr/local/share/postgresql/extension
# renovate: datasource=github-tags depName=pg_prove lookupName=theory/tap-parser-sourcehandler-pgtap versioning=perl
ARG PG_PROVE_VERSION=v3.36
# renovate: datasource=github-tags depName=pgtap lookupName=theory/pgtap
ARG PGTAP_VERSION=v1.3.3
# renovate: datasource=github-tags depName=TAP::Harness::JUnit lookupName=jlavallee/tap-harness-junit versioning=perl
ARG TAP_HARNESS_JUNIT_VERSION=v0.40
### set up multi-process logging
RUN mkfifo /var/log/stdout \
### install deps
; apk add \
--no-cache \
# nss_wrapper is currently only available in testing
--repository https://dl-cdn.alpinelinux.org/alpine/edge/community \
coreutils \
nss_wrapper \
entr \
git \
# to silence initdb "locale not found" warnings
musl-locales \
perl \
perl-xml-simple \
the_silver_searcher \
tmux \
### build deps
; apk add \
--no-cache \
--virtual build-deps \
build-base \
clang15 \
llvm15 \
perl-dev \
perl-module-build \
perl-test-deep \
perl-test-pod \
perl-test-pod-coverage \
su-exec \
### pg_prove
; git clone --depth 1 --branch ${PG_PROVE_VERSION} https://github.com/theory/tap-parser-sourcehandler-pgtap \
; (cd tap-parser-sourcehandler-pgtap \
; perl Build.PL \
; ./Build \
; ./Build test \
; ./Build install \
) \
### pgtap
; git clone --depth 1 --branch ${PGTAP_VERSION} https://github.com/theory/pgtap \
; (cd pgtap \
; make \
; make install \
# Running these pgtap tests implicitly tests pg_prove and with pg, too.
; with pg with make installcheck \
; with pg with sql <(echo "DROP SCHEMA pgtap CASCADE; CREATE EXTENSION pgtap;") with make test \
) \
### tap-harness-junit
; git clone --depth 1 --branch ${TAP_HARNESS_JUNIT_VERSION} https://github.com/jlavallee/tap-harness-junit \
; (cd tap-harness-junit \
; perl Build.PL \
; ./Build \
; ./Build test \
; ./Build install \
) \
### cleanup
; rm -rf -- /usr/src/* /tmp/* \
; apk del --no-cache build-deps
FROM base AS test
RUN apk add \
--no-cache \
ncurses \
yarn \
; yarn global add \
bats \
bats-assert \
bats-support
FROM base