Sign inSign up

ectobit/pg-dump-s3

By ectobit

•Updated almost 4 years ago

Image
0

1.3K

ectobit/pg-dump-s3 repository overview

⁠ectobit/pg-dump-s3⁠

Docker Pulls Stars

This image is based on the latest Ubuntu and contains PostgreSQL client utilities including psql, pg_dump and pg_dumpall but also aws-cli 2 to be able to dump and restore from s3.

⁠Environment variables

  • PGHOST
  • PGPORT (optional, defaults to 5432)
  • PGOPTIONS (optional connection flags, see PostgreSQL documentation)
  • PGUSER
  • PGPASSWORD
  • DBS (comma separated list of databases to be dumped)
  • EXTRA_OPTS (optional, extra options to pass to pg_dump command)

⁠Example usage to dump databases to S3

apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: pg-dump-s3
spec:
  schedule: '3 3 * * *'
  concurrencyPolicy: Forbid
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: pg-dump-s3
              image: ectobit/pg-dump-s3
              imagePullPolicy: Always
              env:
                - name: PGHOST
                  value: postgresql
                - name: PGUSER
                  value: postgres
                - name: PGPASSWORD
                  valueFrom:
                    secretKeyRef:
                      name: postgresql
                      key: postgres-password
                - name: DBS
                  value: auth_service,other_service
                - name: AWS_ACCESS_KEY_ID
                  value: { { requiredEnv "S3_ACCESS_KEY_ID" } }
                - name: AWS_SECRET_ACCESS_KEY
                  value: { { requiredEnv "S3_SECRET_ACCESS_KEY" } }
                - name: S3_BUCKET
                  value: bucket/sub-bucket
          restartPolicy: OnFailure
      ttlSecondsAfterFinished: 172800

Tag summary

Content type

Image

Digest

sha256:4baaa1684…

Size

86.2 MB

Last updated

almost 4 years ago

docker pull ectobit/pg-dump-s3