-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile.tmpl
More file actions
28 lines (22 loc) · 825 Bytes
/
Dockerfile.tmpl
File metadata and controls
28 lines (22 loc) · 825 Bytes
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
FROM postgres:${PG_VERSION}-alpine
ENV LANG=C.UTF-8 PGDATA=/pg/data
RUN if [ "${CHECK_CODE}" = "clang" ] ; then \
apk --no-cache add clang-analyzer make musl-dev gcc icu-dev; \
fi
RUN if [ "${CHECK_CODE}" = "cppcheck" ] ; then \
apk --no-cache add cppcheck --repository http://dl-cdn.alpinelinux.org/alpine/v3.6/community; \
fi
RUN if [ "${CHECK_CODE}" = "false" ] ; then \
apk --no-cache add git curl gcc make musl-dev icu-dev;\
fi
RUN mkdir -p /pg/data && \
mkdir /pg/src && \
chown postgres:postgres ${PGDATA} && \
chmod a+rwx /usr/local/lib/postgresql && \
chmod a+rwx /usr/local/share/postgresql/extension && \
chmod a+rwx /usr/local/include/postgresql/server
ADD . /pg/src
WORKDIR /pg/src
RUN chmod -R go+rwX /pg/src
USER postgres
ENTRYPOINT PGDATA=${PGDATA} CHECK_CODE=${CHECK_CODE} bash run_tests.sh