LinuxForHealth / images

Linux For Health Container Images
Apache License 2.0
2 stars 2 forks source link

Add PostgreSQL Dockerfile and README #15

Closed srcarrier closed 4 years ago

srcarrier commented 4 years ago

This PR contributes to the resolution of LinuxForHealth/connect#59

Once built:

$ docker run -p 5432:5432 IMAGE

To test connectivity once the image is started:

$ psql -U postgres -h localhost -p 5432
postgres=# create database test;

postgres=# \l
                             List of databases
   Name    |  Owner   | Encoding  | Collate | Ctype |   Access privileges   
-----------+----------+-----------+---------+-------+-----------------------
 postgres  | postgres | SQL_ASCII | C       | C     | 
 template0 | postgres | SQL_ASCII | C       | C     | =c/postgres          +
           |          |           |         |       | postgres=CTc/postgres
 template1 | postgres | SQL_ASCII | C       | C     | =c/postgres          +
           |          |           |         |       | postgres=CTc/postgres
 test      | postgres | SQL_ASCII | C       | C     | 
(4 rows)

Note: I've not been able to successfully build this PostgreSQL image for platforms linux/s390x and linux/arm64. Getting 404s on the following rpms: linux/s390x : https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-8-s390x/repodata/repomd.xml linux/arm64 : https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-8-aarch64/repodata/repomd.xml

Also, I was not able to get the PostgreSQL image built off the ubi-minimal base image. Had to use ubi-init. Do we want different base images besides ubi-minimal or should I include some of the LABEL commands in this image?

tedtanne commented 4 years ago

did u try this on the r-pi? https://opensource.com/article/17/10/set-postgres-database-your-raspberry-pi

srcarrier commented 4 years ago

did u try this on the r-pi? https://opensource.com/article/17/10/set-postgres-database-your-raspberry-pi

No, but I'm curious how well this container would run in that environment.

srcarrier commented 4 years ago

@dixonwhitmire any suggestions for that CMD statement? ☝️ Two issues:

  1. static reference to pgsql-12
  2. reference to ${PGDATA} in exec form These are easily addressed by switching from exec form to shell, but from what I've read the exec form is preferred for CMD and ENTRYPOINT instructions. Another option may be to add an ENTRYPOINT and pass in some of the commands via docker run.
srcarrier commented 4 years ago

Feedback has been incorporated, thanks Dixon