Last changed
docker pull cgr.dev/chainguard/postgres
Need access to a specific version? Contact us.
Be the first to hear about exciting product updates, critical vulnerability alerts, compare alternative images, and more.
Sign UpMinimal PostgreSQL image. EXPERIMENTAL
The image is available on cgr.dev
:
The only mandatory environment variable needed by the PostgreSQL Image is POSTGRES_PASSWORD
.
You can test the PostgreSQL Image by running the following command:
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 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:
Please refer to our guide on getting started with the PostgreSQL Chainguard Image for an in-depth walk-through of how you can use the PostgreSQL Image in practice. 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.
Chainguard Images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" version of this image:
Apache-2.0
BSD-1-Clause
BSD-3-Clause
BSD-4-Clause-UC
CC-PDDC
GCC-exception-3.1
GPL-1.0-only
For a complete list of licenses, please refer to this Image's SBOM.
Software license agreementA FIPS validated version of this image is available for FedRAMP compliance. STIG is included with FIPS image.