Skip to content

Commit 41e2469

Browse files
author
Paulo Gomes da Cruz Junior
authored
fix: init container (#150)
* chore: updating init container for testing * chore: updating init container for testing * chore: updating init container for testing * feat: moving init from java to shell * chore: adding cert secret * fix: setting a version for the dockerfile * chore: changing image to prevent access denied * chore: changing image to prevent access denied * chore: changing image to prevent access denied
1 parent 967843f commit 41e2469

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
FROM alpine:3.17.3@sha256:b6ca290b6b4cdcca5b3db3ffa338ee0285c11744b4a6abaa9627746ee3291d8d
1+
FROM eclipse-temurin:17.0.6_10-jdk-alpine@sha256:a765a97826df90554f3d3a98be5586012bbc53593876f669ff4b2e68717be71d
22

33
ENV LANG en_CA.UTF-8
44
ENV LANGUAGE en_CA.UTF-8
55
ENV LC_ALL en_CA.UTF-8
66

7-
RUN apk --no-cache add openssl openjdk8
7+
WORKDIR /app
88

9-
RUN which openssl
10-
RUN which keytool
9+
RUN apk --no-cache add openssl
1110

1211
COPY startup.sh .
1312

14-
RUN chmod g+x startup.sh
13+
RUN chmod g+w /app && \
14+
chmod g+x startup.sh && \
15+
chmod g+w ${JAVA_HOME}/lib/security/cacerts
1516

1617
# Non-privileged user
1718
USER app

startup.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ generate_cert() {
1212

1313
openssl s_client -connect ${ORACLEDB_HOST}:${ORACLEDB_PORT} -showcerts </dev/null | openssl x509 -outform pem > $cert_folder/${ORACLEDB_HOST}.pem
1414
openssl x509 -outform der -in $cert_folder/${ORACLEDB_HOST}.pem -out $cert_folder/${ORACLEDB_HOST}.der
15-
keytool -import -alias ${ORACLEDB_HOST} -keystore $cert_file -file $cert_folder/${ORACLEDB_HOST}.der -storepass ${ORACLEDB_SECRET} -noprompt
15+
keytool -import -alias ${ORACLEDB_HOST} -keystore $cert_folder/$cert_file -file $cert_folder/${ORACLEDB_HOST}.der -storepass ${ORACLEDB_SECRET} -noprompt
1616

17-
cp $cert_file $cert_folder/$cert_file
1817
echo "Generated $cert_file and copied it to $cert_folder."
1918
}
2019

0 commit comments

Comments
 (0)