File tree Expand file tree Collapse file tree 7 files changed +39
-5
lines changed
Expand file tree Collapse file tree 7 files changed +39
-5
lines changed Original file line number Diff line number Diff line change 4141 Zookeeper (),
4242 Kafka (),
4343 SchemaRegistry (),
44- Postgres (),
44+ Postgres (volumes = [ "secrets:/certs:ro" ] ),
4545 MySql (),
4646 Cockroach (setup_materialize = True , in_memory = True ),
4747 # Overridden below
Original file line number Diff line number Diff line change @@ -105,7 +105,9 @@ def create_postgres(
105105 else :
106106 image = f"postgres:{ pg_version } "
107107
108- return Postgres (image = image , extra_command = extra_command )
108+ return Postgres (
109+ image = image , extra_command = extra_command , volumes = ["secrets:/certs:ro" ]
110+ )
109111
110112
111113def get_testdrive_ssl_args (c : Composition ):
Original file line number Diff line number Diff line change @@ -92,7 +92,9 @@ def create_postgres(
9292 else :
9393 image = f"postgres:{ pg_version } "
9494
95- return Postgres (image = image , extra_command = extra_command )
95+ return Postgres (
96+ image = image , extra_command = extra_command , volumes = ["secrets:/certs:ro" ]
97+ )
9698
9799
98100SERVICES = [
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ def create_mzs(
102102 Minio (setup_materialize = True , additional_directories = ["copytos3" ]),
103103 Azurite (),
104104 Mc (),
105- Postgres (),
105+ Postgres (volumes = [ "secrets:/certs:ro" ] ),
106106 MySql (),
107107 SqlServer (),
108108 Zookeeper (),
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ RUN apt-get update --fix-missing && TZ=UTC DEBIAN_FRONTEND=noninteractive apt-ge
1818 && rm -rf /var/lib/apt/lists/* \
1919 && rm -rf /usr/share/doc/* /usr/share/man/* /usr/share/info/* /usr/share/locale/* /var/cache/* /var/log/*
2020
21+ # Bake in certs from test-certs as a build-time default.
2122COPY --chown=postgres --from=certs /secrets/* /share/secrets/
2223COPY pg_hba.conf /share/conf/pg_hba.conf
2324COPY setup-postgres.sh /docker-entrypoint-initdb.d/setup-postgres.sh
25+ COPY entrypoint-wrapper.sh /usr/local/bin/entrypoint-wrapper.sh
26+
27+ ENTRYPOINT ["entrypoint-wrapper.sh" ]
28+ CMD ["postgres" ]
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Copyright Materialize, Inc. and contributors. All rights reserved.
4+ #
5+ # Use of this software is governed by the Business Source License
6+ # included in the LICENSE file at the root of this repository.
7+ #
8+ # As of the Change Date specified in that file, in accordance with
9+ # the Business Source License, use of this software will be governed
10+ # by the Apache License, Version 2.0.
11+
12+ # Override baked-in TLS certificates with runtime certs from the test-certs
13+ # container (shared via the secrets volume at /certs). This ensures postgres
14+ # always uses the same CA that tests read from the test-certs container,
15+ # eliminating mismatches when Docker images are rebuilt independently.
16+
17+ set -euo pipefail
18+
19+ if [ -f /certs/postgres.crt ]; then
20+ cp /certs/* /share/secrets/
21+ chown -R postgres:postgres /share/secrets
22+ chmod 600 /share/secrets/postgres.key
23+ fi
24+
25+ exec docker-entrypoint.sh " $@ "
Original file line number Diff line number Diff line change 4040 Materialized (),
4141 Testdrive (consistent_seed = True ),
4242 SshBastionHost (),
43- Postgres (),
43+ Postgres (volumes = [ "secrets:/certs:ro" ] ),
4444 TestCerts (),
4545 Redpanda (),
4646 MySql (),
You can’t perform that action at this time.
0 commit comments