diff --git a/docs/en_US/container_deployment.rst b/docs/en_US/container_deployment.rst index 46b882cd4..d0800a621 100644 --- a/docs/en_US/container_deployment.rst +++ b/docs/en_US/container_deployment.rst @@ -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 ********************* diff --git a/docs/en_US/release_notes_4_3.rst b/docs/en_US/release_notes_4_3.rst index 5ddd0e042..35e7cfc14 100644 --- a/docs/en_US/release_notes_4_3.rst +++ b/docs/en_US/release_notes_4_3.rst @@ -13,7 +13,8 @@ Features | `Feature #2233 `_ - Add a "scratch pad" to the Query Tool to hold text snippets whilst editing. | `Feature #3439 `_ - Allow X-FRAME-OPTIONS to be set for security. Default to SAMEORIGIN. | `Feature #3559 `_ - Automatically expand child nodes as well as the selected node on the treeview if there is only one. -| `Feature #3991 `_ - Update Alpine Linux version in the docker container. This also updates the PG utilities to v11. +| `Feature #3886 `_ - Include multiple versions of the PG utilties in containers. +| `Feature #3991 `_ - Update Alpine Linux version in the docker container. Bug fixes ********* diff --git a/pkg/docker/Dockerfile b/pkg/docker/Dockerfile index 6fd2fccb3..0d66bcf0c 100644 --- a/pkg/docker/Dockerfile +++ b/pkg/docker/Dockerfile @@ -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 diff --git a/pkg/docker/config_distro.py b/pkg/docker/config_distro.py index 71ad3c741..9763f5445 100644 --- a/pkg/docker/config_distro.py +++ b/pkg/docker/config_distro.py @@ -1,4 +1,4 @@ HELP_PATH = '../../docs' DEFAULT_BINARY_PATHS = { - 'pg': '/usr/bin' + 'pg': '/usr/local/pgsql-11' }