diff --git a/athena-oracle/Dockerfile b/athena-oracle/Dockerfile index eaeafac1b6..8aa92e6d7c 100644 --- a/athena-oracle/Dockerfile +++ b/athena-oracle/Dockerfile @@ -1,9 +1,19 @@ FROM public.ecr.aws/lambda/java:11 -# Copy function code and runtime dependencies from Maven layout +ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk +ENV PATH=$JAVA_HOME/bin:$PATH + +#copy java default cacerts +COPY src/main/resources/cacerts /usr/lib/jvm/java-11-openjdk/lib/security/cacerts + +# Add server certificates to the default trust store +COPY src/main/resources/oracle-server.crt /tmp/ +RUN keytool -import -trustcacerts -file /tmp/oracle-server.crt \ + -alias orclcert -keystore $JAVA_HOME/lib/security/cacerts -storepass changeit -noprompt + +# Add your application jar COPY target/athena-oracle-2022.47.1.jar ${LAMBDA_TASK_ROOT} -# Unpack the jar -RUN jar xf athena-oracle-2022.47.1.jar +ENV JAVA_TOOL_OPTIONS="-Djavax.net.ssl.trustStore=/usr/lib/jvm/java-11-openjdk/lib/security/cacerts -Djavax.net.ssl.trustStorePassword=changeit" -# Command can be overwritten by providing a different command in the template directly. -# No need to specify here (already defined in .yaml file because legacy and connections use different) +# Unpack the jar +RUN jar xf athena-oracle-2022.47.1.jar \ No newline at end of file diff --git a/athena-oracle/src/main/resources/cacerts b/athena-oracle/src/main/resources/cacerts new file mode 100644 index 0000000000..38dd3a5e9f Binary files /dev/null and b/athena-oracle/src/main/resources/cacerts differ diff --git a/athena-oracle/src/main/resources/oracle-server.crt b/athena-oracle/src/main/resources/oracle-server.crt new file mode 100644 index 0000000000..2bd4d22f96 --- /dev/null +++ b/athena-oracle/src/main/resources/oracle-server.crt @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID/zCCAuegAwIBAgIRAPVSMfFitmM5PhmbaOFoGfUwDQYJKoZIhvcNAQELBQAw +gZcxCzAJBgNVBAYTAlVTMSIwIAYDVQQKDBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJ +bmMuMRMwEQYD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