AV
Size: a a a
AV
ZP

ZP
ZP
AV
ЕЯ
PG
A
ZP
ZP
AV
ZP
ZP
ZP
ЕЯ
FROM postgres:11
COPY --chown=postgres:postgres adminui/* /docker-entrypoint-initdb.d/
COPY --chown=postgres:postgres integrationapi/* /docker-entrypoint-initdb.d/
COPY --chown=postgres:postgres src/new_hba.sql /docker-entrypoint-initdb.d
WORKDIR certs/
COPY --chown=postgres:postgres src/cert_link.sh .
RUN bash cert_link.sh
RUN localedef -i ru_RU -c -f UTF-8 -A /usr/share/locale/locale.alias ru_RU.UTF-8
USER postgres
В контейнере подключился к бд, пусто. Плюс pg_hba файл не заменился.
Так запускаю
docker run -d \
--name $db_container \
-p 5432:5432 \
-e POSTGRES_PASSWORD=example \
-v $keystore:/usr/src/keystore \
-v pgdata:/var/lib/postgresql/data \
$image_my_postgresql \
-c ssl=on \
-c ssl_ca_file=/certs/cert.pem \
-c ssl_cert_file=/certs/cert.pem \
-c ssl_key_file=/certs/key.pem \
PG
ЕЯ
create table hba ( lines text );
copy hba from '/var/lib/postgresql/data/pg_hba.conf';
delete from hba where lines = 'host all all all md5';
insert into hba (lines) values ('host all all ::1/128 md5');
copy hba to '/var/lib/postgresql/data/pg_hba.conf';
select pg_reload_conf();
вот так можно редактировать pg_hba
PG