04-25-2021 12:26 PM
I am using ACS 7, and creating my own custome Docker image. I used the AIO as a starting point, and I can create an amp with all my customaizatrions in it. I can create a image, and start it up.
One of my customizations is to use a local MySql. But the JDBC driver cannot be found.
What is the right way to get the mysql jar into my image?
I can copy it in the docker file if I use the meven-dependency plugin, but that copies ALL of the dependencies, which I assume are already on the alfresco-acs base docker image.
What is the correct way to do this?
04-26-2021 03:39 PM
The database driver jar file should not go in your amp. Have a look at the following pom.xml file:
https://github.com/Alfresco/alfresco-community-repo/blob/master/packaging/docker-alfresco/pom.xml
This is the pom file that puts together the community repo docker image. You'll notice that there is an execution plugin called "copy-jdbc-connectors". It simply copies the postgres jar file into a directory called "connectors" (under the "target" directory). And then in the Dockerfile:
https://github.com/Alfresco/alfresco-community-repo/blob/master/packaging/docker-alfresco/Dockerfile
You can see that the contents of that "connector" directory get copied into the tomcat/lib directory:
COPY ${resource_path}/connector/* ${TOMCAT_DIR}/lib/
You can follow this pattern if you like and simply copy the jar using an execution plugin and then copy it into your Dockerfile. Or you can use any other process that results in the jar file being copied into the tomcat lib dir in your docker image.
-Doug
04-26-2021 03:39 PM
The database driver jar file should not go in your amp. Have a look at the following pom.xml file:
https://github.com/Alfresco/alfresco-community-repo/blob/master/packaging/docker-alfresco/pom.xml
This is the pom file that puts together the community repo docker image. You'll notice that there is an execution plugin called "copy-jdbc-connectors". It simply copies the postgres jar file into a directory called "connectors" (under the "target" directory). And then in the Dockerfile:
https://github.com/Alfresco/alfresco-community-repo/blob/master/packaging/docker-alfresco/Dockerfile
You can see that the contents of that "connector" directory get copied into the tomcat/lib directory:
COPY ${resource_path}/connector/* ${TOMCAT_DIR}/lib/
You can follow this pattern if you like and simply copy the jar using an execution plugin and then copy it into your Dockerfile. Or you can use any other process that results in the jar file being copied into the tomcat lib dir in your docker image.
-Doug
04-30-2021 10:42 AM
Hi @mangar
Great that you found a resolution to your problem and thanks for accepting this solution - it will help other users out who have the same problem.
Cheers,
Explore our Alfresco products with the links below. Use labels to filter content by product module.