I have an RDS postgresql,
created a customized docker image of liquibase (testliquibase:2.0) from the liquibase/liquibase
My purpose is run this customized docker container to update the RDS.
I did successfully to do these from the local host command line and also inside the container.
I tested run the container from command directly or from inside the container both worked.
Worked 1 --From linux–
[linux–jumpbox] docker run --net=“host” -v /userhome/changelog:/liquibase/changelog testliquibase:2.0 --defaultsFile=“./changelog/liquibase.rds.properties” update --log-level flag
Worked 2-- get inside the container with this–
[linux–jumpbox] docker run --net=“host” -it --entrypoint “/bin/bash” --name test2.1 testliquibase:2.0
Now inside the container
[linux–jumpbox:/liquibase]
docker-entrypoint.sh --defaultsFile=./changelog/liquibase.rds.properties update
Failed with the CMD command when did the docker run.
Same CMD inside the Dockerfile–
CMD [ “bash”, “-c”, “docker-entrypoint.sh --defaultsFile=./changelog/liquibase.rds.properties update --log-level flag” ]
[linux–jumpbox] docker run testliquibase:2.0
Got error–
Liquibase Open Source 4.20.0 by Liquibase
[2023-03-17 15:19:29] INFO [liquibase.integration] Starting command execution.
Connection could not be created to RDURL with driver org.postgresql.Driver. The connection attempt failed.
liquibase.exception.CommandExecutionException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Connection could not be created to jdbc:postgresql:RDURL with driver org.postgresql.Driver. The connection attempt failed.
at liquibase.command.CommandScope.execute(CommandScope.java:209)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:55)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:24)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at liquibase.integration.commandline.LiquibaseCommandLine.lambda$null$2(LiquibaseCommandLine.java:367)
at liquibase.Scope.child(Scope.java:196)
at liquibase.Scope.child(Scope.java:172)
at liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$3(LiquibaseCommandLine.java:332)
at liquibase.Scope.child(Scope.java:196)
at liquibase.Scope.child(Scope.java:172)
at liquibase.integration.commandline.LiquibaseCommandLine.execute(LiquibaseCommandLine.java:330)
at liquibase.integration.commandline.LiquibaseCommandLine.main(LiquibaseCommandLine.java:91)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at liquibase.integration.commandline.LiquibaseLauncher.main(LiquibaseLauncher.java:107)
Caused by: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Connection could not be created to RDSURL with driver org.postgresql.Driver. The connection attempt failed.