forked from blacklabelops-legacy/postgres
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (30 loc) · 916 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
35
FROM blacklabelops/alpine:3.4
MAINTAINER Steffen Bleul <[email protected]>
# Build time arguments
# Values: latest or version number (e.g. 9.4.6-r0)
ARG POSTGRES_VERSION=latest
RUN apk add --update \
curl \
gpgme && \
if [ "${POSTGRES_VERSION}" = "latest" ]; \
then apk add postgresql ; \
else apk add "postgresql=${POSTGRES_VERSION}" ; \
fi && \
# Install gosu
curl -fsSL https://github.com/tianon/gosu/releases/download/1.10/gosu-amd64 -o /usr/local/bin/gosu && \
chmod +x /usr/local/bin/gosu && \
# Remove obsolete packages
apk del \
curl \
gpgme && \
# Clean caches and tmps
rm -rf /var/cache/apk/* && \
rm -rf /tmp/* && \
rm -rf /var/log/*
ENV LANG en_US.utf8
ENV PGDATA /var/lib/postgresql/data
COPY docker-entrypoint.sh /
VOLUME ["/var/lib/postgresql"]
EXPOSE 5432
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["postgres"]