forked from abn/pgtap-container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (24 loc) · 871 Bytes
/
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
ARG PG_CONTAINER_VERSION=9.6
FROM postgres:${PG_CONTAINER_VERSION}
ARG PGTAP_VERSION=1.1.0
RUN apk -U add \
alpine-sdk \
perl \
&& git clone https://github.com/theory/pgtap \
&& cd pgtap \
&& git checkout v${PGTAP_VERSION} \
&& make \
&& make install
FROM postgres:${PG_CONTAINER_VERSION}
ENV PGTAP_TEST_DIR=/opt/pgtap/tests
COPY --from=0 /usr/local/share/postgresql/extension/pgtap* /usr/local/share/postgresql/extension/
RUN apk -U add \
build-base \
perl-dev \
&& PERL_MM_USE_DEFAULT=1 cpan TAP::Parser::SourceHandler::pgTAP \
&& apk del -r build-base \
&& install -d ${PGTAP_TEST_DIR}
COPY ./assets/docker-entrypoint-initdb.d/*.sql /docker-entrypoint-initdb.d/
RUN wget --quiet -O /usr/bin/wait-for https://raw.githubusercontent.com/eficode/wait-for/master/wait-for \
&& chmod +x /usr/bin/wait-for
VOLUME ${PGTAP_TEST_DIR}