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?
Solved! Go to Solution.
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
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
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,
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.