/
DirectorySecurity Advisories
Sign In
Directory
pg-timetable logo

pg-timetable

Last changed

Create your Free Account

Be the first to hear about exciting product updates, critical vulnerability alerts, compare alternative images, and more.

Sign Up
Tags
Overview
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 Containers are minimal container images that are secure by default.

In many cases, the Chainguard Containers tagged as :latest contain only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager. Chainguard Containers are built with Wolfi, our Linux undistro 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 -dev variant.

Although the -dev container image variants have similar security features as their more minimal versions, they feature additional software that is typically not necessary in production environments. We recommend using multi-stage builds to leverage the -dev variants, copying application artifacts into a final minimal container that offers a reduced attack surface that won’t allow package installations or logins.

Learn More

To better understand how to work with Chainguard Containers, please visit Chainguard Academy and Chainguard Courses.

In addition to Containers, Chainguard offers VMs and Libraries. Contact Chainguard to access additional products.

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-3-Clause

  • GCC-exception-3.1

  • GPL-2.0-or-later

  • GPL-3.0-or-later

  • LGPL-2.0-or-later

  • LGPL-2.1-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

Category
application

Safe Source for Open Sourceâ„¢
Media KitContact Us
© 2025 Chainguard. All Rights Reserved.
Private PolicyTerms of Use

Products

Chainguard ContainersChainguard LibrariesChainguard VMs