Skip to content

Commit f2fb361

Browse files
committed
Support Docker containers with more than one IP address
Before we would fail if there where more than one.
1 parent f7f6c33 commit f2fb361

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

context/base/docker-entrypoint.d/20-certs.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ CERT_KEY="/cert/${FIRST_VIRTUAL_HOST:-localhost}.key"
77
CA_CERT="/rootCA/rootCA.pem"
88
CA_KEY="/rootCA/rootCA-key.pem"
99

10-
IP_ADDRESS=$(hostname -i)
11-
export IP_ADDRESS
12-
1310
envsubst </etc/https-proxy/cert.cfg.template >/tmp/cert.cfg
1411

1512
for host in ${VIRTUAL_HOST:-localhost}; do
1613
echo "dns_name = $host" >>/tmp/cert.cfg
1714
done
1815

16+
for ip_address in $(hostname -i); do
17+
echo "ip_address = $ip_address" >>/tmp/cert.cfg
18+
done
19+
1920
certtool --generate-privkey --outfile "${CERT_KEY}"
2021

2122
if [ ! -r "${CA_CERT}" ] || [ ! -r "${CA_KEY}" ]; then

context/base/etc/https-proxy/cert.cfg.template

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ organization = "Development certificate"
22
unit = "${HOSTNAME}"
33
cn = "${FIRST_VIRTUAL_HOST}"
44
expiration_days = ${EXPIRATION_DAYS}
5-
ip_address = "${IP_ADDRESS}"

0 commit comments

Comments
 (0)