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