File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
OracleLinuxDevelopers/oraclelinux9/httpd/2.4 Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 11FROM ghcr.io/oracle/oraclelinux:9
22
3- RUN dnf install -y httpd && \
3+ RUN dnf install -y httpd mod_ssl && \
44 rm -rf /var/cache/dnf
55
6- CMD ["httpd" , "-DFOREGROUND" ]
6+ ENV CERTIFICATE_DIR /etc/pki/tls/certs
7+ ENV KEY_DIR /etc/pki/tls/private
8+
9+ COPY ./entrypoint.sh /opt/entrypoint.sh
10+
11+ CMD ["/opt/entrypoint.sh" ]
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -eu pipefail
4+
5+ SERVER_CERT=" $CERTIFICATE_DIR /localhost.crt"
6+ SERVER_KEY=" $KEY_DIR /localhost.key"
7+
8+ if [ ! -f " $SERVER_KEY " ]; then
9+ echo " Generating certificate private key for SSL support"
10+ openssl genpkey -algorithm RSA -out " $SERVER_KEY "
11+ fi
12+
13+ if [ ! -f " $SERVER_CERT " ]; then
14+ echo " Generating self-signed certificates for SSL support"
15+ openssl req -x509 -new -nodes -key " $SERVER_KEY " -sha256 -days 3650 -out " $SERVER_CERT " -subj " /C=US/ST=California/L=San Francisco/O=Test Company/CN=localhost"
16+ fi
17+
18+ httpd -DFOREGROUND
You can’t perform that action at this time.
0 commit comments