Sign inSign up

openkylin/postgres

By openkylin

•Updated 10 months ago

Image
0

431

openkylin/postgres repository overview

⁠Quick reference

⁠PostgreSQL | openKylin

Current PostgreSQL docker images are built on the openKylin⁠. This repository is free to use and exempted from per-user rate limits.

PostgreSQL is a powerful, open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.

Learn more about PostgreSQL on the PostgreSQL Website⁠.

The tag of each postgres docker image is consist of the version of postgres and the version of basic image. The details are as follows

TagCurrentlyArchitectures
18.1-ok20⁠Postgres 18.1 on openKylin 2.0amd64, arm64, riscv64

⁠Usage

In this usage, users can select the corresponding {Tag} and container startup options based on their requirements.

  • Pull the openkylin/postgres image from docker

    # From Docker Hub
    docker pull openkylin/postgres:{Tag}
    # From Quay
    docker pull quay.io/openkylin/postgres:{Tag}
    
  • Start a postgres instance

    docker run -d --name my-postgres -p 30432:5432 -e POSTGRES_PASSWORD=PostgreSQL@123 openkylin/postgres:{Tag}
    

    After the instance my-postgres is started, access the PostgreSQL service through http://localhost:30432.

  • Container startup options

    OptionDescription
    -p 30432:5432Expose PostgreSQL server on localhost:30432.
    -e POSTGRES_PASSWORD=passwdSet the password for the superuser which is postgres by default. Bear in mind that to connect to the database in the same host the password is not needed but to access it via an external host (for instance another container) the password is needed. This option is mandatory and must not be empty.
    -e POSTGRES_USER=postgresCreate a new user with superuser privileges. This is used in conjunction with POSTGRES_PASSWORD.
    -e POSTGRES_INITDB_ARGS="--data-checksums"Pass arguments to the postgres initdb call.
    -e POSTGRES_DB=postgresSet the name of the default database.
    -e POSTGRES_INITDB_WALDIRSet the location of the Postgres transaction log. By default it is stored in a subdirectory of the main Postgres data folder (PGDATA).
    -e POSTGRES_HOST_AUTH_METHOD=trustSet the auth-method for host connections for all databases, all users, and all addresses. The following will be added to the pg_hba.conf if this option is passed: host all all all $POSTGRES_HOST_AUTH_METHOD.
    -e PGDATA=/path/to/locationSet the location of the database files. The default is /var/lib/postgresql/data.
    -v /path/to/postgresql.conf:/etc/postgresql/postgresql.confLocal configuration file postgresql.conf.
    -v /path/to/persisted/data:/var/lib/postgresql/dataPersist data instead of initializing a new database every time you launch a new container.
  • View container running logs

    docker logs -f my-postgres
    
  • To get an interactive shell

    docker exec -it my-postgres /bin/bash
    

⁠Question and answering

If you have any questions or want to use some special features, please submit an issue or a pull request on openkylin-docker-images⁠.

Tag summary

Content type

Image

Digest

sha256:e0fe6cf9d…

Size

272.8 MB

Last updated

10 months ago

docker pull openkylin/postgres