-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (44 loc) · 1.8 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
ARG POSTGRES_VERSION="13-alpine"
ARG PGTAP_VERSION="v1.1.0"
from postgres:${POSTGRES_VERSION}
COPY installcheck-pgtap.sh /docker-entrypoint-initdb.d/
COPY docker-healthcheck /usr/local/bin/
COPY create-extension.sql /docker-entrypoint-initdb.d/
# TODO: move musl-locale to a builder image
# TODO: move pgtap to a builder image
RUN set -ex && \
apk add --no-cache make && \
apk add --no-cache --virtual .build-dependencies \
cmake make musl-dev gcc gettext-dev libintl \
postgresql \
postgresql-contrib \
build-base \
patch \
diffutils \
git \
perl && \
git clone git://github.com/theory/pgtap.git && \
chown -R postgres:postgres pgtap/ && \
cd pgtap/ && \
git checkout ${PGTAP_VERSION} && \
make && make install && \
apk del .build-dependencies
LABEL maintainer="lmergner@gmail.com"
LABEL version.release="0.1.0" version.pgtap="${PGTAP_VERSION}" version.postgres="${POSTGRES_VERSION}"
LABEL org.opencontainers.image.source https://github.com/lmergner/docker-pgtap
LABEL org.opencontainers.image.authors "Luke Mergner <lmergner@gmail.com>"
LABEL org.opencontainers.image.version="0.1.0"
LABEL org.opencontainers.image.title="docker-pgtap" name="docker-pgtap"
HEALTHCHECK CMD [ "docker-healthcheck" ]
# TODO: Set healthcheck intervals...
# https://docs.docker.com/engine/reference/builder/#healthcheck
# The options that can appear before CMD are:
#
# --interval=DURATION (default: 30s)
# --timeout=DURATION (default: 30s)
# --start-period=DURATION (default: 0s)
# --retries=N (default: 3)
# TODO: figure out how to slim down the size of the image. We can't
# delete the pgtap/ repo because then we can't run makeinstall
# when the container inits.
# rm -r /pgtap only seems to save 20 mb