|
1 |
| -FROM quay.io/deis/base:v0.3.6 |
| 1 | +FROM postgres:11 |
2 | 2 |
|
3 |
| -ENV LANG=en_US.utf8 \ |
4 |
| - PG_MAJOR=9.4 \ |
5 |
| - PG_VERSION=9.4.17-1.pgdg16.04+1 \ |
6 |
| - PGDATA=/var/lib/postgresql/data |
| 3 | +ARG DEBIAN_FRONTEND=noninteractive |
| 4 | +ARG BUILD_DEPS='gcc git libffi-dev libssl-dev python3-dev python3-pip python3-wheel' |
7 | 5 |
|
8 |
| -# Set this separately from those above since it depends on one of them |
9 |
| -ENV PATH=/usr/lib/postgresql/$PG_MAJOR/bin:$PATH |
10 |
| - |
11 |
| -# Add postgres user and group |
12 |
| -RUN adduser --system \ |
13 |
| - --shell /bin/bash \ |
14 |
| - --disabled-password \ |
15 |
| - --group \ |
16 |
| - postgres |
17 |
| - |
18 |
| -RUN buildDeps='gcc git libffi-dev libssl-dev python3-dev python3-pip python3-wheel' && \ |
19 |
| - localedef -i en_US -c -f UTF-8 -A /etc/locale.alias en_US.UTF-8 && \ |
20 |
| - export DEBIAN_FRONTEND=noninteractive && \ |
21 |
| - apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 && \ |
22 |
| - echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ |
23 |
| - apt-get update && \ |
| 6 | +RUN apt-get update && \ |
24 | 7 | apt-get install -y --no-install-recommends \
|
25 |
| - $buildDeps \ |
| 8 | + $BUILD_DEPS \ |
26 | 9 | gosu \
|
27 | 10 | lzop \
|
28 |
| - postgresql-$PG_MAJOR=$PG_VERSION \ |
29 |
| - postgresql-contrib-$PG_MAJOR=$PG_VERSION \ |
| 11 | + libpq-dev \ |
30 | 12 | pv \
|
31 | 13 | python3 \
|
32 |
| - postgresql-common \ |
33 | 14 | util-linux \
|
34 | 15 | # swift package needs pkg_resources and setuptools
|
35 | 16 | python3-pkg-resources \
|
36 |
| - python3-setuptools && \ |
| 17 | + python3-setuptools \ |
| 18 | + python3-pip && \ |
37 | 19 | ln -sf /usr/bin/python3 /usr/bin/python && \
|
38 |
| - ln -sf /usr/bin/pip3 /usr/bin/pip && \ |
39 |
| - mkdir -p /run/postgresql && \ |
40 |
| - chown -R postgres /run/postgresql && \ |
41 |
| - # setuptools from ubuntu archives is too old for googleapis-common-protos |
42 |
| - pip install --upgrade setuptools && \ |
| 20 | + ln -sf /usr/bin/pip3 /usr/bin/pip |
| 21 | + |
| 22 | +# setuptools from ubuntu archives is too old for googleapis-common-protos |
| 23 | +RUN pip install --upgrade setuptools && \ |
43 | 24 | pip install --disable-pip-version-check --no-cache-dir \
|
44 |
| - envdir==0.7 \ |
45 |
| - wal-e[aws,azure,google,swift]==v1.0.2 \ |
46 |
| - # pin azure-storage to version wal-e uses (see docker-entrypoint.sh) |
47 |
| - azure-storage==0.20.0 && \ |
48 |
| - # "upgrade" boto to 2.43.0 + the patch to fix minio connections |
49 |
| - pip install --disable-pip-version-check --no-cache-dir --upgrade git+https://github.com/teamhephy/boto@88c980e56d1053892eb940d43a15a68af4ebb5e6 && \ |
50 |
| - # cleanup |
51 |
| - apt-get purge -y --auto-remove $buildDeps && \ |
| 25 | + envdir==1.0.1 \ |
| 26 | + wal-e[aws,azure,google,swift]==1.1.0 \ |
| 27 | + gcloud==0.18.3 \ |
| 28 | + oauth2client==4.1.3 \ |
| 29 | + azure-storage==0.20.0 |
| 30 | + |
| 31 | +# cleanup |
| 32 | +RUN apt-get purge -y --auto-remove $BUILD_DEPS && \ |
52 | 33 | apt-get autoremove -y && \
|
53 |
| - apt-get clean -y && \ |
54 |
| - # package up license files if any by appending to existing tar |
55 |
| - COPYRIGHT_TAR='/usr/share/copyrights.tar' && \ |
56 |
| - gunzip -f $COPYRIGHT_TAR.gz && \ |
57 |
| - tar -rf $COPYRIGHT_TAR /usr/share/doc/*/copyright && \ |
58 |
| - gzip $COPYRIGHT_TAR && \ |
59 |
| - rm -rf \ |
60 |
| - /usr/share/doc \ |
61 |
| - /usr/share/man \ |
62 |
| - /usr/share/info \ |
63 |
| - /usr/share/locale \ |
64 |
| - /var/lib/apt/lists/* \ |
65 |
| - /var/log/* \ |
66 |
| - /var/cache/debconf/* \ |
67 |
| - /etc/systemd \ |
68 |
| - /lib/lsb \ |
69 |
| - /lib/udev \ |
70 |
| - /usr/lib/x86_64-linux-gnu/gconv/IBM* \ |
71 |
| - /usr/lib/x86_64-linux-gnu/gconv/EBC* && \ |
72 |
| - bash -c "mkdir -p /usr/share/man/man{1..8}" |
| 34 | + apt-get clean -y |
73 | 35 |
|
74 | 36 | COPY rootfs /
|
75 | 37 | ENV WALE_ENVDIR=/etc/wal-e.d/env
|
76 | 38 | RUN mkdir -p $WALE_ENVDIR
|
77 | 39 |
|
| 40 | +ARG PATCH_CMD="python3 /patcher-script.py" |
| 41 | +RUN $PATCH_CMD file /bin/create_bucket /patcher-script.d/patch_boto_s3.py |
| 42 | +RUN $PATCH_CMD file /usr/local/bin/wal-e /patcher-script.d/patch_boto_s3.py |
| 43 | +RUN $PATCH_CMD module wal_e.worker.worker_util /patcher-script.d/patch_wal_e_s3.py |
| 44 | + |
| 45 | + |
78 | 46 | CMD ["/docker-entrypoint.sh", "postgres"]
|
79 | 47 | EXPOSE 5432
|
0 commit comments