2 Answers
- Newest
- Most votes
- Most comments
0
Hi
I assume The JAVA_ARGS environment variable is likely not being passed correctly. Instead of setting JAVA_ARGS and then running flyway $@, use the exec command to directly execute Flyway with the environment variables. This ensures the variables are inherited by the Java process.
You can check updated script and try it out
#!/bin/bash
set -euo pipefail
echo "Adding RDS Cert"
keytool -keystore /flyway/keystore -alias "AWS RDS Aurora" -noprompt -trustcacerts -storepass "myStorePassword" -importcert -file rds-combined-ca-bundle.pem
keytool -list -keystore /flyway/keystore -storepass "myStorePassword"
export JAVA_ARGS="-Djavax.net.ssl.trustStore=/flyway/keystore -Djavax.net.ssl.trustStorePassword=myStorePassword"
exec java $JAVA_ARGS -jar /flyway/flyway.jar $@
0
Thanks for this, my thinking is along the same lines.
However, I don't have a .jar file in the container:
drwxr-xr-x 1 root root 88 May 15 16:13 .
drwxr-xr-x 1 root root 31 May 15 16:13 ..
drwxr-xr-x 3 root root 47 Mar 14 11:02 assets
drwxr-xr-x 2 root root 33 Mar 14 11:02 conf
drwxr-xr-x 4 root root 4096 Mar 14 11:02 drivers
-rwxr-xr-x 1 root root 1108 May 15 16:12 entrypoint.sh
-rwxr-xr-x 1 2000 2000 1177 Mar 14 10:29 flyway
-rw-r--r-- 1 2000 2000 1007 Mar 14 10:30 flyway.cmd
-rw-r--r-- 1 root root 1430 May 15 16:13 keystore
drwxr-xr-x 7 root root 4096 Mar 14 11:02 lib
drwxr-xr-x 2 root root 56 Mar 14 11:02 licenses
-rw-r--r-- 1 root root 43888 May 15 16:13 rds-combined-ca-bundle.pem
-rw-r--r-- 1 2000 2000 1186 Mar 14 10:27 README.txt
drwxr-xr-x 2 root root 4096 Mar 14 11:02 rules
drwxr-xr-x 3 root root 24 May 15 16:13 sql
And the environment looks OK:
HOSTNAME=7ebfc5988612
LANGUAGE=en_US:en
JAVA_HOME=/opt/java/openjdk
PWD=/flyway
JAVA_ARGS=-Djava.security.egd=file:/dev/../dev/urandom -Djavax.net.ssl.trustStore="/flyway/keystore" -Djavax.net.ssl.trustStorePassword="myStorePassword"
HOME=/root
LANG=en_US.UTF-8
FLYWAY_USER=admin
SHLVL=1
FLYWAY_PASSWORD=84M7f6u%A29Ruj#wsGtv
LC_ALL=en_US.UTF-8
PATH=/flyway:/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
JAVA_VERSION=jdk-17.0.10+7
_=/usr/bin/env
I'm now thinking that the env
when run from the entrypoint.sh command is different than the -e
vars being sent to the docker command. Going to try a few more approaches.
Thanks again.
answered 4 days ago
Relevant content
- asked 10 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated a year ago