-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (27 loc) · 1023 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
36
FROM alpine:3.10 as build
MAINTAINER "Vitali Khlebko [email protected]"
ARG POSTGRES_TAG=REL_12_0
RUN apk update && apk add git g++ make readline-dev zlib-dev perl bison flex linux-headers
RUN cd /tmp &&\
git clone https://github.com/postgres/postgres.git postgres &&\
cd postgres &&\
git checkout ${POSTGRES_TAG} &&\
git config pull.rebase true &&\
./configure &&\
make &&\
make install
FROM alpine:3.10
COPY --from=build /usr/local/pgsql /usr/local/pgsql
ENV LANG en_US.utf8
ENV PGDATA /var/lib/postgresql/data
ENV PATH="/usr/local/pgsql/bin:${PATH}"
COPY docker-entrypoint.sh /scripts/docker-entrypoint.sh
# addgroup -g 70 postgres &&\
# adduser -H -D -u 70 -s /bin/sh -h :/var/lib/postgresql -g "" postgres &&\
RUN apk update && apk add su-exec bash &&\
mkdir -p $PGDATA &&\
mkdir -p /var/run/postgresql &&\
mkdir /docker-entrypoint-initdb.d &&\
chown -R postgres:postgres /var/run/postgresql
ENTRYPOINT ["/scripts/docker-entrypoint.sh"]
CMD ["postgres"]