docker-library / postgres

Docker Official Image packaging for Postgres
http://www.postgresql.org
MIT License
2.16k stars 1.13k forks source link

Adding PgAgent to the images to allow for scheduling #1057

Closed Skyhikeeper closed 1 year ago

Skyhikeeper commented 1 year ago

How would I go about adding PgAgent to the latest docker image so that It can support scheduling?.

yosifkit commented 1 year ago

I think it is just installing the package and creating the extension:

FROM posgres:version
RUN set -eux; \
    apt-get update; \
    apt-get install -y pgagent; \
    rm -rf /var/lib/apt/lists/*; \
    echo 'CREATE EXTENSION pgagent;' > /docker-entrypoint-initdb.d/pgadmin.sql; \
    chown postgres:postgres /docker-entrypoint-initdb.d/pgadmin.sql

But I am unsure where the pgagent binary comes in. Maybe a second container is needed to run the agent? docker run -d custom-pg-image pgagent -f hostaddr=[postgres-dns-name-or-ip] dbname=postgres user=postgres

https://www.pgadmin.org/docs/pgadmin4/development/pgagent_install.html

tianon commented 1 year ago

For further help, I would suggest trying a dedicated support forum, such as the Docker Community Slack, Server Fault, Unix & Linux, or Stack Overflow.