I am using postgres14 inside docker-container. I want my DB to start with custom pg_hba.conf so I created my own dockerfile that adds 1 file to official postgres14 image:
FROM postgres:14.2
COPY pg_hba.conf /ftool/
Now, after building above dockerfile I have following error during start of container:
initdb: error: directory "/ftool" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/ftool" or run initdb
with an argument other than "/ftool".
How do I inject my pg_hba.conf before DB gets initialized?