Include multiple versions of the PG utilties in containers. Fixes #3886

This commit is contained in:
Dave Page 2019-02-20 15:17:16 +00:00
parent aae49b5324
commit a39f43788b
4 changed files with 55 additions and 2 deletions

View File

@ -8,6 +8,24 @@ pgAdmin can be deployed in a container using the image at:
https://hub.docker.com/r/dpage/pgadmin4/
PostgreSQL Utilities
********************
The PostgreSQL utilities *pg_dump*, *pg_dumpall*, *pg_restore* and *psql* are
included in the container to allow backups to be created and restored and other
maintenance functions to be executed. Multiple versions are included in the
following directories to allow use with different versions of the database
server:
* PostgreSQL 9.4: /usr/local/pgsql-9.4
* PostgreSQL 9.5: /usr/local/pgsql-9.5
* PostgreSQL 9.6: /usr/local/pgsql-9.6
* PostgreSQL 10: /usr/local/pgsql-10
* PostgreSQL 11: /usr/local/pgsql-11
The most recent version of the utilities is used by default; this may be
changed in the :ref:`preferences`.
Environment Variables
*********************

View File

@ -13,7 +13,8 @@ Features
| `Feature #2233 <https://redmine.postgresql.org/issues/2233>`_ - Add a "scratch pad" to the Query Tool to hold text snippets whilst editing.
| `Feature #3439 <https://redmine.postgresql.org/issues/3439>`_ - Allow X-FRAME-OPTIONS to be set for security. Default to SAMEORIGIN.
| `Feature #3559 <https://redmine.postgresql.org/issues/3559>`_ - Automatically expand child nodes as well as the selected node on the treeview if there is only one.
| `Feature #3991 <https://redmine.postgresql.org/issues/3991>`_ - Update Alpine Linux version in the docker container. This also updates the PG utilities to v11.
| `Feature #3886 <https://redmine.postgresql.org/issues/3886>`_ - Include multiple versions of the PG utilties in containers.
| `Feature #3991 <https://redmine.postgresql.org/issues/3991>`_ - Update Alpine Linux version in the docker container.
Bug fixes
*********

View File

@ -31,6 +31,13 @@ COPY ./pgadmin4/ /pgadmin4
RUN LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 make -C /pgadmin4/docs/en_US -f Makefile.sphinx html
# Get the PG binaries
FROM postgres:9.4-alpine as pg94-builder
FROM postgres:9.5-alpine as pg95-builder
FROM postgres:9.6-alpine as pg96-builder
FROM postgres:10-alpine as pg10-builder
FROM postgres:11-alpine as pg11-builder
# Then install backend, copy static files and set up entrypoint
FROM python:3.7-alpine3.9
@ -65,6 +72,33 @@ RUN python -O -m compileall /pgadmin4
COPY ./entrypoint.sh /entrypoint.sh
# Copy the PG binaries
COPY --from=pg94-builder /usr/local/bin/pg_dump /usr/local/pgsql-9.4/
COPY --from=pg94-builder /usr/local/bin/pg_dumpall /usr/local/pgsql-9.4/
COPY --from=pg94-builder /usr/local/bin/pg_restore /usr/local/pgsql-9.4/
COPY --from=pg94-builder /usr/local/bin/psql /usr/local/pgsql-9.4/
COPY --from=pg95-builder /usr/local/bin/pg_dump /usr/local/pgsql-9.5/
COPY --from=pg95-builder /usr/local/bin/pg_dumpall /usr/local/pgsql-9.5/
COPY --from=pg95-builder /usr/local/bin/pg_restore /usr/local/pgsql-9.5/
COPY --from=pg95-builder /usr/local/bin/psql /usr/local/pgsql-9.5/
COPY --from=pg96-builder /usr/local/bin/pg_dump /usr/local/pgsql-9.6/
COPY --from=pg96-builder /usr/local/bin/pg_dumpall /usr/local/pgsql-9.6/
COPY --from=pg96-builder /usr/local/bin/pg_restore /usr/local/pgsql-9.6/
COPY --from=pg96-builder /usr/local/bin/psql /usr/local/pgsql-9.6/
COPY --from=pg10-builder /usr/local/bin/pg_dump /usr/local/pgsql-10/
COPY --from=pg10-builder /usr/local/bin/pg_dumpall /usr/local/pgsql-10/
COPY --from=pg10-builder /usr/local/bin/pg_restore /usr/local/pgsql-10/
COPY --from=pg10-builder /usr/local/bin/psql /usr/local/pgsql-10/
COPY --from=pg11-builder /usr/local/bin/pg_dump /usr/local/pgsql-11/
COPY --from=pg11-builder /usr/local/bin/pg_dumpall /usr/local/pgsql-11/
COPY --from=pg11-builder /usr/local/bin/pg_restore /usr/local/pgsql-11/
COPY --from=pg11-builder /usr/local/bin/psql /usr/local/pgsql-11/
# Finish up
VOLUME /var/lib/pgadmin
EXPOSE 80 443

View File

@ -1,4 +1,4 @@
HELP_PATH = '../../docs'
DEFAULT_BINARY_PATHS = {
'pg': '/usr/bin'
'pg': '/usr/local/pgsql-11'
}