enter code herei have my webapplication and h2database as a docker containers. I have docker compose yml file all set. Now, i need to initialize this database ( h2database). But i am unable to do so. When i go inside h2database docker container, i see docker-entrypoint-initdb.d/initdb.sh inside this initdb.sh i have added my script
#!/bin/bash
java -cp h2-1.4.190.jar org.h2.tools.RunScript \
-script /App1/BasePl/sql-scripts/h2/common-scripts/BasePl-schema-h2.sql \ -url "jdbc:h2:http://localhost/code1/Demo2./BasePl"
but when i try to execute this initdb.sh using bash command it gives me error : Could not find or load main class org.h2.tools.RunScript
I have tried all possible class path combinations and also downloaded different h2 jarfiles zip folders and also checked for RunScript file under h2\src\main\org\h2\tools and its there. So i do not understand what is the issue here.
Error: Could not find or load main class org.h2.tools.RunScript
my Docker-compose.yml file:
version: '3'
services:
baseplapplication:
build:
context: .
dockerfile: Dockerfile
environment:
BASEPL_HOME: "/usr/local/BASEPL"
ports:
- "882:8080"
volumes:
- basepl_data:/var/bio
depends_on:
- db
links:
- db
db:
image: "buildo/h2database"
volumes:
- ./dumps/init.sh:/docker-entrypoint-initdb.d/initdb.sh
- h2data:/var/lib/h2database
ports:
- "8082:8082"
volumes:
basepl_data:
h2data:
now the initdb will be created when i run docker-compose command and thus i need to go inside the database(db) container to the location of initdb.sh and then put my script #!/bin/bash java -cp h2-1.4.190.jar org.h2.tools.RunScript \ -script /App1/BasePl/sql-scripts/h2/common-scripts/BasePl-schema-h2.sql \ -url "jdbc:h2:http://localhost/code1/Demo2./BasePl" . How could i then put my h2-1.4.190.jar file which is located on my desktop to that location inside the database(db) container. All i want is to populate (initialize) the docker database by running a script against it during docker compose. Please i am new to docker so help me