/
DirectorySecurity AdvisoriesPricing
Sign in
Directory
pg-timetable logo

pg-timetable

Last changed

Request a free trial

Contact our team to test out this image for free. Please also indicate any other images you would like to evaluate.

Tags
Overview
Comparison
Provenance
Specifications
SBOM
Vulnerabilities
Advisories

Chainguard Container for pg-timetable

An advanced standalone job scheduler for PostgreSQL, offering many advantages over traditional schedulers such as cron and others.

Chainguard Containers are regularly-updated, secure-by-default container images.

Download this Container Image

For those with access, this container image is available on cgr.dev:

docker pull cgr.dev/ORGANIZATION/pg-timetable:latest

Be sure to replace the ORGANIZATION placeholder with the name used for your organization's private repository within the Chainguard Registry.

Compatibility Notes

Chainguard's pg_timetable image is comparable to the cybertecpostgresql/pg_timetable image from Docker Hub. It is designed to be minimal and secure and is optimized for running inside a containerized environment. This image is designed to connect to a PostgreSQL instance with SSL/TLS enabled for secure database communications.

Getting Started

Below is an example of how to deploy pg_timetable using Docker with a PostgreSQL database secured with TLS:

Start by creating a Docker Network:

docker network create pg-timetable-net || true

Next, generate SSL certificates:

mkdir -p /tmp/certs
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:4096 -out /tmp/certs/ca.key
openssl req -x509 -new -nodes -key /tmp/certs/ca.key -sha256 -days 1024 -out /tmp/certs/ca.crt -subj "/CN=localhost"

openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:4096 -out /tmp/certs/server.key
openssl req -new -key /tmp/certs/server.key -out /tmp/certs/server.csr -subj "/CN=localhost"
openssl x509 -req -in /tmp/certs/server.csr -CA /tmp/certs/ca.crt -CAkey /tmp/certs/ca.key -CAcreateserial -out /tmp/certs/server.crt -days 365

Be sure to change the owenrship of certs either to root or to the UID/GID of Postgres (for example, 70:70) as that is a hard requirement for Postgres in enabling TLS:

 sudo chown 70:70 /tmp/certs/server.key
 sudo chmod 600 /tmp/certs/server.key

Next, start PostgreSQL with SSL enabled:

docker run -d --network=pg-timetable-net --name=postgres \
  -e POSTGRES_DB=timetable \
  -e POSTGRES_USER=scheduler \
  -e POSTGRES_PASSWORD=scheduler \
  -v /tmp/certs:/certs:rw \
  cgr.dev/ORGANIZATION/postgres:latest \
  -c ssl=on \
  -c ssl_cert_file='/certs/server.crt' \
  -c ssl_key_file='/certs/server.key' \
  -c ssl_ca_file='/certs/ca.crt'

Following that, start pg_timetable:

docker run --rm -d --network=pg-timetable-net --name=pg-timetable \
  -p 8008:8008 \
  -e PGTT_URL="postgresql://scheduler:scheduler@postgres:5432/timetable?sslmode=verify-ca&sslrootcert=/certs/ca.crt" \
  -e PGTT_RESTPORT=8008 \
  -e PGTT_RESTHOST="0.0.0.0" \
  -v /tmp/certs:/certs \
  cgr.dev/ORGANIZATION/pg-timetable:latest \
  pg_timetable -c worker001

Verify that pg_timetable is ready:

until docker exec pg-timetable curl -s -o /dev/null -w "%{http_code}" http://0.0.0.0:8008/liveness | grep "200"; do
  sleep 2
done
echo "pg_timetable is ready."

You can then insert tasks like in the following example:

CHAIN_ID=$(docker exec postgres psql "sslmode=verify-ca sslrootcert=/certs/ca.crt" \
  -U scheduler -d timetable -t -A -c \
  "INSERT INTO timetable.chain (chain_name, live) VALUES ('Test Chain', TRUE) RETURNING json_build_object('chain_id', chain_id);" \
  | grep '{' | jq -r '.chain_id')

docker exec postgres psql "sslmode=verify-ca sslrootcert=/certs/ca.crt" \
  -U scheduler -d timetable -c \
  "INSERT INTO timetable.task (chain_id, task_order, kind, command) VALUES ($CHAIN_ID, 1, 'SQL', 'SELECT now();');"

And verify the logs:

2025-03-19 19:04:43.609 [INFO] [chain:1] Starting chain
2025-03-19 19:04:43.611 [INFO] [chain:1] [vxid:12884901926] Chain executed successfully

Documentation and Resources

What are Chainguard Containers?

Chainguard's free tier of Starter container images are built with Wolfi, our minimal Linux undistro.

All other Chainguard Containers are built with Chainguard OS, Chainguard's minimal Linux operating system designed to produce container images that meet the requirements of a more secure software supply chain.

The main features of Chainguard Containers include:

For cases where you need container images with shells and package managers to build or debug, most Chainguard Containers come paired with a development, or -dev, variant.

In all other cases, including Chainguard Containers tagged as :latest or with a specific version number, the container images include only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager.

Although the -dev container image variants have similar security features as their more minimal versions, they include additional software that is typically not necessary in production environments. We recommend using multi-stage builds to copy artifacts from the -dev variant into a more minimal production image.

Need additional packages?

To improve security, Chainguard Containers include only essential dependencies. Need more packages? Chainguard customers can use Custom Assembly to add packages, either through the Console, chainctl, or API.

To use Custom Assembly in the Chainguard Console: navigate to the image you'd like to customize in your Organization's list of images, and click on the Customize image button at the top of the page.

Learn More

Refer to our Chainguard Containers documentation on Chainguard Academy. Chainguard also offers VMs and Libraries — contact us for access.

Trademarks

This software listing is packaged by Chainguard. The trademarks set forth in this offering are owned by their respective companies, and use of them does not imply any affiliation, sponsorship, or endorsement by such companies.

Licenses

Chainguard container images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" tag of this image:

  • Apache-2.0

  • BSD-2-Clause

  • BSD-3-Clause

  • GCC-exception-3.1

  • GPL-2.0-only

  • GPL-2.0-or-later

  • GPL-3.0-or-later

For a complete list of licenses, please refer to this Image's SBOM.

Software license agreement

Compliance

A FIPS validated version of this image is available for FedRAMP compliance. STIG is included with FIPS image.


Related images
pg-timetable-fips logoFIPS
pg-timetable-fips

Category
application

Safe Source for Open Sourceâ„¢
Contact us
© 2025 Chainguard. All Rights Reserved.
Private PolicyTerms of Use

Product

Chainguard ContainersChainguard LibrariesChainguard VMsIntegrationsPricing