sameersbn / docker-postgresql

Dockerfile to build a PostgreSQL container image which can be linked to other containers.
MIT License
1.05k stars 468 forks source link

fix PG_DATADIR initialization for cases when empty or contains too many files #152

Closed kkimurak closed 1 year ago

kkimurak commented 2 years ago

Previous implementation passed nothing to chmod when PG_DATADIR is empty. This results in chmod raises syntax error and wrong permissions will not be corrected : This is the cause of problem reported in sameersbn/docker-gitlab#2224
We also can see Argument list too long error when PG_DATADIR contains too many files / directories (restriction defined by ARG_MAX) : this is reported in #148

This PR make create_datadir() to handle those situations by using xargs.

kkimurak commented 1 year ago

Rebased onto 0c081e0 (14-20230628 release).