09-30-2019 04:18 AM
Hi,
someones know if there is a guide to deploy and amp (or jar) module into a dockerized alfresco 6.1.
Thanks in advance.
10-01-2019 11:09 AM
Amp files needs to be installed unlike jar files. When you copy jar files to WEB-INF/lib (as shown here) and restart, it loads the module on restart without any additional action. But when you have amps, you need to apply them using alfresco-mmt after ftping them to their respective folders such as /usr/local/tomcat/amps and /usr/local/tomcat/amps_share.
Here are the steps you need to do:
For Alfresco layer:
1- Copy repo amp to "/usr/local/tomcat/amps"
docker cp C:\alf-addon\js-console\javascript-console-repo\target\javascript-console-repo-0.7-SNAPSHOT.amp 2bf46dd1ae7dd05dd6e28a790d867e581376fa64f8482a124f25139de21ec96c:/usr/local/tomcat/amps
2- Apply amp:
java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install /usr/local/tomcat/amps /usr/local/tomcat/webapps/alfresco -directory -nobackup -force
3- Restart container:
docker container restart 2bf46dd1ae7
here, 2bf46dd1ae7 is the container id
4-You can tail the log to see if module is installed or not. It will show something like this :
For Share layer:
1- Copy repo amp to "/usr/local/tomcat/amps_share"
docker cp C:\alf-addon\js-console\javascript-console-share\target\javascript-console-share-0.7-SNAPSHOT.amp 653e41842aed205d3f18ef5b2be6816ab550eddea2161fb03f6168658c964545:/usr/local/tomcat/amps_share
2- Apply amp:
java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install /usr/local/tomcat/amps_share /usr/local/tomcat/webapps/share -directory -nobackup -force
3- Restart container:
docker container restart 653e41842ae
here, 653e41842ae is the container id
4-You can tail the log to see if module is installed or not. It will show something like this :
08-18-2020 07:24 AM
@akash251998 wrote:
I have copied the pdf-toolkit-repo-1.4.4-SNAPSHOT.amp to the location /usr/local/tomcat/amps after that i have run the command : java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install /usr/local/tomcat/amps_share /usr/local/tomcat/webapps/share -directory -nobackup -force
But it is giving error in the command line: Error: Unable to access jarfile /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar
@akash251998 You have copied the amp file at '/usr/local/tomcat/amps' but trying to run install from amps_share. It seems like you are trying to apply amps without connecting to containers.
Following syntax is used for copying local file to a container:
docker cp localFile FULLCONTAINER_ID:pathOnContainer ##### Get container name or short container id: - docker ps ##### Get full container id: - docker inspect -f '{{.Id}}' CONTAINER_ID
CONTAINER_ID can be found using the 'docker ps' command given above.
Instructions to copy and apply amps for Alfresco:
1- Copy repo amp 'pdf-toolkit-repo-1.4.4-SNAPSHOT.amp' to "/usr/local/tomcat/amps" on ACS container
For example, repo amp 'pdf-toolkit-repo-1.4.4-SNAPSHOT.amp' is in c drive under alf-addon folder:
docker cp C:\alf-addon\pdf-toolkit-repo-1.4.4-SNAPSHOT.amp 2bf46dd1ae7dd05dd6e28a790d867e581376fa64f8482a124f25139de21ec96c:/usr/local/tomcat/amps where '2bf46dd1ae7dd05dd6e28a790d867e581376fa64f8482a124f25139de21ec96c' is full container id. See the commands above for getting this id for ACS container.
2- Connect to the container using below command:
docker exec -i -t <containerId> or <containerName> /bin/bash
Example:
docker exec -i -t demo_alfresco_1 /bin/bash Here, 'demo_alfresco_1' is the name of acs container, alternatively you can use id as well.
3- Apply amp after connecting to bash shell of acs container using above command:
java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install /usr/local/tomcat/amps /usr/local/tomcat/webapps/alfresco -directory -nobackup -force
4- Restart container
Instructions to copy and apply amps for Share:
1- Copy repo amp 'pdf-toolkit-share-1.4.4-SNAPSHOT.amp' to "/usr/local/tomcat/amps_share" on Share container
docker cp C:\alf-addon\pdf-toolkit-share-1.4.4-SNAPSHOT.amp 653e41842aed205d3f18ef5b2be6816ab550eddea2161fb03f6168658c964545:/usr/local/tomcat/amps_share
2- Connect to the share container using below command:
docker exec -i -t demo_share_1 /bin/bash Here, 'demo_share_1' is the name of share container.
3- Apply amp:
java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install /usr/local/tomcat/amps_share /usr/local/tomcat/webapps/share -directory -nobackup -force
4- Restart container
See previous solution for more details. Open a separate thread if you still see the problem.
See this post on more docker and docker-compose related useful commands:
https://javaworld-abhinav.blogspot.com/2019/11/alfresco-6x-with-sdk4x-and-docker.html
10-02-2019 05:32 AM
It is a good idea to keep backups, but Its up to you whether you want to keep a back up file or not.
08-18-2020 12:56 AM
I have copied the pdf-toolkit-repo-1.4.4-SNAPSHOT.amp to the location /usr/local/tomcat/amps after that i have run the command : java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install /usr/local/tomcat/amps_share /usr/local/tomcat/webapps/share -directory -nobackup -force
But it is giving error in the command line: Error: Unable to access jarfile /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar
08-18-2020 07:24 AM
@akash251998 wrote:
I have copied the pdf-toolkit-repo-1.4.4-SNAPSHOT.amp to the location /usr/local/tomcat/amps after that i have run the command : java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install /usr/local/tomcat/amps_share /usr/local/tomcat/webapps/share -directory -nobackup -force
But it is giving error in the command line: Error: Unable to access jarfile /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar
@akash251998 You have copied the amp file at '/usr/local/tomcat/amps' but trying to run install from amps_share. It seems like you are trying to apply amps without connecting to containers.
Following syntax is used for copying local file to a container:
docker cp localFile FULLCONTAINER_ID:pathOnContainer ##### Get container name or short container id: - docker ps ##### Get full container id: - docker inspect -f '{{.Id}}' CONTAINER_ID
CONTAINER_ID can be found using the 'docker ps' command given above.
Instructions to copy and apply amps for Alfresco:
1- Copy repo amp 'pdf-toolkit-repo-1.4.4-SNAPSHOT.amp' to "/usr/local/tomcat/amps" on ACS container
For example, repo amp 'pdf-toolkit-repo-1.4.4-SNAPSHOT.amp' is in c drive under alf-addon folder:
docker cp C:\alf-addon\pdf-toolkit-repo-1.4.4-SNAPSHOT.amp 2bf46dd1ae7dd05dd6e28a790d867e581376fa64f8482a124f25139de21ec96c:/usr/local/tomcat/amps where '2bf46dd1ae7dd05dd6e28a790d867e581376fa64f8482a124f25139de21ec96c' is full container id. See the commands above for getting this id for ACS container.
2- Connect to the container using below command:
docker exec -i -t <containerId> or <containerName> /bin/bash
Example:
docker exec -i -t demo_alfresco_1 /bin/bash Here, 'demo_alfresco_1' is the name of acs container, alternatively you can use id as well.
3- Apply amp after connecting to bash shell of acs container using above command:
java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install /usr/local/tomcat/amps /usr/local/tomcat/webapps/alfresco -directory -nobackup -force
4- Restart container
Instructions to copy and apply amps for Share:
1- Copy repo amp 'pdf-toolkit-share-1.4.4-SNAPSHOT.amp' to "/usr/local/tomcat/amps_share" on Share container
docker cp C:\alf-addon\pdf-toolkit-share-1.4.4-SNAPSHOT.amp 653e41842aed205d3f18ef5b2be6816ab550eddea2161fb03f6168658c964545:/usr/local/tomcat/amps_share
2- Connect to the share container using below command:
docker exec -i -t demo_share_1 /bin/bash Here, 'demo_share_1' is the name of share container.
3- Apply amp:
java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install /usr/local/tomcat/amps_share /usr/local/tomcat/webapps/share -directory -nobackup -force
4- Restart container
See previous solution for more details. Open a separate thread if you still see the problem.
See this post on more docker and docker-compose related useful commands:
https://javaworld-abhinav.blogspot.com/2019/11/alfresco-6x-with-sdk4x-and-docker.html
08-19-2020 02:09 AM
08-19-2020 05:55 AM
Hi @akash251998,
Thanks for updating - it helps other people to know what worked.
Cheers,
Explore our Alfresco products with the links below. Use labels to filter content by product module.