Add support for custom container user permissions via PUID and PGID environment variables. When the container is started as root (--user root), the pgadmin user is reassigned to the requested UID/GID and all initialization runs under that user via su-exec, ensuring files are created with correct ownership from the start. Key changes: - Dockerfile: add su-exec package, add chmod g=u for /run/pgadmin (fixes OpenShift random UID access) - entrypoint.sh: add PUID/PGID validation and privilege dropping before initialization (not after), preserving OpenShift compatibility Three modes supported: - Default (USER 5050): unchanged behavior - Custom UID (--user root -e PUID=N -e PGID=N): drops to target user before any init - OpenShift (random UID, GID 0): passwd fixup + group permissions |
||
|---|---|---|
| .. | ||
| README.md | ||
| entrypoint.sh | ||
| gunicorn_config.py | ||
| run_pgadmin.py | ||
README.md
pgAdmin Docker Container Builds
This directory contains the files required to create a docker container running pgAdmin.
Building
From the top level directory of the pgAdmin source tree, simply run:
docker build .
You can also run make docker, which will call docker build . but also tag the image like:
pgadmin4 pgadmin4:latest pgadmin4:4 pgadmin4:4.12
WARNING
The build should be run in a CLEAN source tree. Whilst some potentially dangerous files such as config_local.py or log files will be explicitly excluded from the final image, other files will not be.
Running
See the documentation at docs/en_US/container_deployment.rst for information on running the container.