|
1 | | -FROM docker.io/minio/mc:latest as mc |
| 1 | +FROM docker.io/drycc/base:bullseye |
2 | 2 |
|
3 | | - |
4 | | -FROM docker.io/library/golang:buster as builder |
5 | | -ARG GOBIN=/usr/local/bin |
6 | | -ARG WAL_G_VERSION=v1.1 |
7 | | - |
8 | | -RUN apt-get update \ |
9 | | - && apt-get install -y git gcc liblzo2-dev cmake \ |
10 | | - && git clone --dept 1 -b $WAL_G_VERSION https://github.com/wal-g/wal-g $GOPATH/src/github.com/wal-g/wal-g \ |
11 | | - && cd $GOPATH/src/github.com/wal-g/wal-g \ |
12 | | - && make install \ |
13 | | - && make deps \ |
14 | | - && make pg_install |
15 | | - |
16 | | - |
17 | | -FROM docker.io/library/postgres:14-bullseye |
18 | | - |
19 | | -COPY rootfs / |
20 | | -COPY --from=mc /usr/bin/mc /bin/mc |
21 | | -COPY --from=builder /usr/local/bin/wal-g /bin/wal-g |
22 | | - |
23 | | -ENV PGDATA $PGDATA/$PG_MAJOR |
| 3 | +ENV PGDATA /opt/drycc/postgresql/14/data |
24 | 4 | ENV WALG_ENVDIR /etc/wal-g.d/env |
25 | 5 |
|
26 | | -RUN mkdir -p $WALG_ENVDIR \ |
27 | | - && apt-get update \ |
28 | | - && apt-get install -y --no-install-recommends \ |
29 | | - jq \ |
30 | | - python3 \ |
31 | | - ca-certificates \ |
32 | | - python3-pip \ |
33 | | - && pip3 install envdir |
| 6 | +COPY rootfs/bin /bin/ |
| 7 | +COPY rootfs/docker-entrypoint-initdb.d /docker-entrypoint-initdb.d/ |
| 8 | +COPY rootfs/docker-entrypoint.sh /docker-entrypoint.sh |
| 9 | +ENV JQ_VERSION="1.6" \ |
| 10 | + GOSU_VERSION="1.14" \ |
| 11 | + MC_VERSION="2022.02.26.03.58.31" \ |
| 12 | + WAL_G_VERSION="1.1" \ |
| 13 | + PYTHON_VERSION="3.10.2" \ |
| 14 | + POSTGRESQL_VERSION="14.2" |
34 | 15 |
|
| 16 | +RUN mkdir -p $WALG_ENVDIR \ |
| 17 | + && install-stack jq $JQ_VERSION \ |
| 18 | + && install-stack gosu $GOSU_VERSION \ |
| 19 | + && install-stack mc $MC_VERSION \ |
| 20 | + && install-stack wal-g $WAL_G_VERSION \ |
| 21 | + && install-stack python $PYTHON_VERSION \ |
| 22 | + && install-stack postgresql $POSTGRESQL_VERSION && . init-stack \ |
| 23 | + && rm -rf \ |
| 24 | + /usr/share/doc \ |
| 25 | + /usr/share/man \ |
| 26 | + /usr/share/info \ |
| 27 | + /usr/share/locale \ |
| 28 | + /var/lib/apt/lists/* \ |
| 29 | + /var/log/* \ |
| 30 | + /var/cache/debconf/* \ |
| 31 | + /etc/systemd \ |
| 32 | + /lib/lsb \ |
| 33 | + /lib/udev \ |
| 34 | + /usr/lib/`echo $(uname -m)`-linux-gnu/gconv/IBM* \ |
| 35 | + /usr/lib/`echo $(uname -m)`-linux-gnu/gconv/EBC* \ |
| 36 | + && mkdir -p /usr/share/man/man{1..8} \ |
| 37 | + && mkdir -p /run/postgresql $PGDATA \ |
| 38 | + && groupadd postgres && useradd -g postgres postgres \ |
| 39 | + && chown -R postgres:postgres /run/postgresql $PGDATA \ |
| 40 | + && set -eux; pip3 install --disable-pip-version-check --no-cache-dir envdir 2>/dev/null |
| 41 | + |
| 42 | +ENTRYPOINT ["init-stack"] |
35 | 43 | CMD ["/docker-entrypoint.sh", "postgres"] |
36 | 44 | EXPOSE 5432 |
0 commit comments