Last changed
Contact our team to test out this image for free. Please also indicate any other images you would like to evaluate.
Request trialAdvanced object-relational database management system
Chainguard Containers are regularly-updated, secure-by-default container images.
For those with access, this container image is available on cgr.dev
:
Be sure to replace the ORGANIZATION
placeholder with the name used for your organization's private repository within the Chainguard Registry.
The Chainguard postgres-fips
image is comparable to the PostgreSQL image from Docker Hub. However, the Chainguard postgres-fips
image contains only the minimum set of tools and dependencies needed to function; for example, it does not include a package manager. Unlike many other Chainguard Containers, though, the PostgreSQL image does include a shell, allowing you to manage databases interactively.
This Chainguard Container ships with a validated redistribution of OpenSSL's FIPS provider module. For more on FIPS support in Chainguard Containers, consult the guide on FIPS-enabled Chainguard Containers on Chainguard Academy.
When migrating an existing PostgresSQL database to use one of Chainguard's PostgreSQL container images it is likely that the collation version in the Chainguard container image will be different from the collation version in the original image that created the database. This may be due to different glibc versions, use of a different implementation of the C standard library (musl in Alpine for example), or the use of different locale configuration.
Chainguard recommends that you re-index and refresh the collation version when migrating to this image before the database is put back into production.
This section provides a high-level overview of how you can use Chainguard's postgres-fips
container image. For a more in-depth walkthrough of how you can use the image in practice, please refer to our guide on getting started with the PostgreSQL Chainguard Container. This getting started guide outlines how to set up and run a PHP application that stores its data in a PostgreSQL database running within a containerized environment.
You can test the postgres-fips
image by running the following command:
Note that the only environment variable required by the postgres-fips
container image is POSTGRES_PASSWORD
.
This command will run the Image, but no data within the PostgreSQL database will persist after the Image stops running. To persist PostgreSQL data you can mount a volume mapped to the container's data folder:
In a new terminal, exec
into the running container:
Connect using the postgres user:
Use the createdb
wrapper to create a test database:
Then use the PostgreSQL client to Connect to the new database:
From there you can interact with the database as you would with any other PostgreSQL database. For instance, you can create a sample table:
You could then insert data into the table:
You can also use all of PostgreSQL's internal meta-commands. For example, \dt
will list all the tables stored within the database:
You can extend Chainguard's Postgres image with environment variables. Chainguard's Postgres image is compatible with the environment variables available in the official PostgreSQL image, including the following:
PGDATA
: This variable allows you to define another location for database files. The default data directory is /var/lib/postgresql/data
.POSTGRES_PASSWORD
: This environment variable sets the superuser password for PostgreSQL. This variable is required to use the Postgres image.POSTGRES_USER
: This is used with the POSTGRES_PASSWORD
variable to set a superuser for the database and its password. If not specified, you can use the default postgres
user.POSTGRES_DB
: Using this variable allows you to set a different name for the default database. If not specified, the default database will be postgres
or the value set by POSTGRES_USER
.POSTGRES_INITDB_ARGS
: This variable allows you to send arguments to postgres initdb
.POSTGRES_INITDB_WALDIR
: You can set this variable to define the location for the PostgreSQL transaction log. By default, the transaction log is stored in a subdirectory of the main PostgresSQL data folder, which you can define with PGDATA
.POSTGRES_HOST_AUTH_METHOD
: This variable allows you to control the auth-method
used to authenticate when connecting to the database.Note that if you set the POSTGRES_HOST_AUTH_METHOD
variable to trust
, then the POSTGRES_PASSWORD
variable is no longer required:
Additionally, be aware that the Docker specific variables will only have an effect if you start the container with an empty data directory; pre-existing databases won't be affected on container startup.
You can also run the Chainguard Postgres image with a custom configuration file. The following example will mount a PostgreSQL configuration file named my-postgres.conf
to the container.
This command also uses the postgres
server's -c
flag to set the config_file
runtime parameter.
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.
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.
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.
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-1-Clause
BSD-2-Clause
BSD-3-Clause
BSD-4-Clause-UC
CC-PDDC
GCC-exception-3.1
For a complete list of licenses, please refer to this Image's SBOM.
Software license agreementThis is a FIPS validated image for FedRAMP compliance.
This image is STIG hardened and scanned against the DISA General Purpose Operating System SRG with reports available.
Learn more about STIGsGet started with STIGs