I have installed alfresco 6 using docker and its working.
I have made some customization and I want to deploy that as jar in alfresco.
How can I deploy that?
It would be better if you could use SDK to build the image with your customization within. Else you will have to manually deploy the jar files/amps/configs every time.
If you attempting to apply amps, You can copy your amp file directly to "$TOMCAT_DIR/amps (/usr/local/tomcat/amps)" and try if that works.
This is what you would see in $TOMCAT_DIR/amps. A Dockerfile and some amps.
If you open Dockerfile in editor, you can see it is trying to apply all the amps:
All is working, thanks!
See the Alfresco documentation for Alfresco Simple Module's:
Simple Modules are located in the modules/platform or modules/share folder of your Alfresco Content Services installation, depending on whether they are an extension for Platform or Share respectively.
An alternative is adding the jar inside the unpacked Alfresco application, in the following directory:
$TOMCAT_DIR/webapps/alfresco/WEB-INF/lib/
The Alfresco Maven SDK 4 is using the latter approach. (See: Maven SDK 4 docker file)
If you generate your customization project with the Alfresco Maven SDK 4, you'll have a full test docker setup available.
If you are using Gradle as a build tool, you can use the Alfresco Docker Gradle Plugin to easily build custom docker images with Simple Modules / Module Packages installed.
I have followed this instruction. https://docs.alfresco.com/6.0/tasks/deploy-docker-compose.html
At which location modules/platform or modules/share will generate?I am using linux.
It looks like those paths aren't available inside the container.
I would suggest adding your extension to
In which file and where I need to add?
If you are using SDK4.0.0 and made the custom changes in your code. Then stop the container using ./run.sh stop command
then execute the ./run.sh build_start command again.
If you are using AIO project structure then you have option to refresh the Alfresco and Share individually to load latest changes.
See ./run.bat or ./run.sh file for more commands.
It you are not using SDK, then probably you have to ftp your customizations to container and copy them to <tomcat_InstallDir>/webapps/alfresco/WEB-INF/lib directory for repo layer changes and <tomcat_InstallDir>/webapps/share/WEB-INF/lib directory for share layer changes.
Additionally you can copy the extension to <tomcatInstallDir>/shared/classes/alfresco/extension (repo layer)
<tomcatInstallDir>/shared/classes/alfresco/web-extension (share)
folders.
Jar deployment approach available or not?
JAR and AMP both options are available. It depends which way you have setup your environment. If you are using SDK, it would be easily deployed like mentioned above.
Else copy the jar files manually "$TOMCAT_DIR/webapps/alfresco/WEB-INF/lib (e.g. /usr/local/tomcat/webapps/alfresco/WEB-INF/lib) directory for repo layer changes and $TOMCAT_DIR/webapps/share/WEB-INF/lib (e.g. /usr/local/tomcat/webapps/share/WEB-INF/lib) directory for share layer changes"
Method 1:
Execute following commands from powershell, i am just trying to show how to copy a file to container. Same way you can copy jar files.
#Get container name or short container id:
- docker ps
#Get full container id:
- docker inspect -f '{{.Id}}' SHORT_CONTAINER_ID-or-CONTAINER_NAME
Example: ac23e51fd0b5c4cc11a12133ceea16d603e7f105d8d39873c75d7cfdd5942e40
#Copy file:
- docker cp localFile FULLCONTAINER_ID:smileytongue:athOnContainer
Example:- docker cp C:\custom-log4j.properties ac23e51fd0b5c4cc11a12133ceea16d603e7f105d8d39873c75d7cfdd5942e40:/usr/local/tomcat/shared/classes/alfresco/extension
Once you are done copying the file, restart the container.
Method 2:
SSH into the container and copy the jar file as needed....
#SSH into the container using container name or container id
- docker exec -t -i docker_acs6-aio-demo-project-acs_1 /bin/bash
You can execute all Linux commands here... i am logged into alfresco container. Once you are done copying file into alfresco container, do the same steps as given above for share to copy your customization.
Same question. What path to upload simple module (with config, META-INF folders etc) into the alfresco docker container?
If you are using SDK, then simply add the dependency under repo/share docker module e.g.
<dependencies> <dependency> <groupId>com.github.abhinavmishra14</groupId> <artifactId>acs6-project-platform</artifactId> <version>${project.parent.version}</version> </dependency> <dependency> <groupId>com.github.abhinavmishra14</groupId> <artifactId>acs6-project-integration-tests</artifactId> <version>${project.parent.version}</version> <scope>test</scope> <classifier>tests</classifier> </dependency> <!-- Add any additional AMPs or extension JARs here that you want to be deployed in Alfresco -->
</dependencies>
After adding the dependency, build the project again. Use /run.bat (run.sh) build_start.
Copy the jar file to lib folder of acs and share if you are not building via sdk::
$TOMCAT_DIR/webapps/alfresco/WEB-INF/lib/ (for repo layer) e.g. /usr/local/tomcat/webapps/alfresco/WEB-INF/lib/
$TOMCAT_DIR/webapps/share/WEB-INF/lib/ (for share). e.g. /usr/local/tomcat/webapps/share/WEB-INF/lib/
The above directory structures are from Alfresco 6.1 based on docker
I just copied my jars to $TOMCAT_DIR/webapps/alfresco/WEB-INF/lib/ and restarted via docker-compose restart and nothing happened, it doesnt see the module
Vladimir Ivanov I am not sure how you copied the files and what steps you followed to restart the container. But it works as mentioned.
Can you try the steps as i have outlined below:
Suppose I have a "javascript-console-repo" module jar file which i wanted to copy to the lib folder i.e. $TOMCAT_DIR/webapps/alfresco/WEB-INF/lib/ (/usr/local/tomcat/webapps/alfresco/WEB-INF/lib/)
Steps:
1- Confirm what all modules are installed by tailing the log of already running container:
6 modules found:
2- Find out the container id using below command:
"docker container ls"
3- Take the container id of alfresco repository and get the full container id.
"docker inspect -f '{{.Id}}' <CONTAINER_ID>"
e.g. docker inspect -f '{{.Id}}' c2379f72c0cd (here c2379f72c0cd is the container id)
4- Using full container id, execute the below given command to copy the file to appropriate location:
"docker cp \addOns\javascript-console-repo-0.6.jar c2379f72c0cd27b052f2b09a8d6e8926ac8676b0fa995eca8de4ce736c602d90:/usr/local/tomcat/webapps/alfresco/WEB-INF/lib"
Jar file is located in a folder on my windows laptop.
5- Check if the jar file is copied to correct location, run following command to connect to container:
"docker exec -t -i docker_acs6-aio-demo-project-acs_1 /bin/bash" (here docker_acs6-aio-demo-project-acs_1 is the name of my alfresco container)
After you connect to container, use the command: "find / -name javascript-console-repo-0.6.jar" to locate the jar file recently copied.
6- Now restart the container, use following command:
"docker restart <CONTAINER_ID>"
e.g. docker restart c2379f72c0cd (here c2379f72c0cd is the container id)
7- Tail the log to see latest modules list:
7 Modules found. see newly added module as highlighted: