cancel
Showing results for 
Search instead for 
Did you mean: 

Deploy amp or jar into dockerized alfresco 6.1

davidm
Confirmed Champ
Confirmed Champ

Hi,

someones know if there is a guide to deploy and amp (or jar) module into a dockerized alfresco 6.1.

Thanks in advance.

2 ACCEPTED ANSWERS

abhinavmishra14
World-Class Innovator
World-Class Innovator

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 :

image

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 :

image

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

View answer in original post


@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

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

View answer in original post

15 REPLIES 15

abhinavmishra14
World-Class Innovator
World-Class Innovator

Are you using SDK4 for generating the jar/amp?  or trying to deploy an external jar/amp in an already running container?

Go through this post, it may help you: https://hub.alfresco.com/t5/alfresco-content-services-forum/alfresco-6-deploy-jar/m-p/154184

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

I want to install js-console add-on amp in a dockerized alfresco 6.1, i have no sdk project yet.

javascript-console module has more files into the amp, like .properties, .messages etc. If i copy just jar file, i doesnt work. is there any way to install an AMP?

abhinavmishra14
World-Class Innovator
World-Class Innovator

You can install amp, look at the link i mentioned above. There is a discussion as to how to install amps.

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

Thanks in advance abhinavmishra14 for the replys,

can you confirm if this resume to apply an AMP over a dockerized Alfresco is right:
1. ftp the AMP over platform container
docker cp C:\alf-addon\js-console\javascript-console-repo\target\javascript-console-repo-0.7-SNAPSHOT.amp 2bf46dd1ae7dd05dd6e28a790d867e581376fa64f8482a124f25139de21ec96c:/usr/local/tomcat/amps
2. ftp the AMP over share container
docker cp C:\alf-addon\js-console\javascript-console-share\target\javascript-console-share-0.7-SNAPSHOT.amp 653e41842aed205d3f18ef5b2be6816ab550eddea2161fb03f6168658c964545:/usr/local/tomcat/amps_share
3. Check the amps exist in the container with the commands bash:

docker exec -it alfresco_v61_alfresco_1 /bin/bash

docker exec -it alfresco_v61_share_1 /bin/bash

4. Restart containers
docker restart 2bf46dd1ae7dd05dd6e28a790d867e581376fa64f8482a124f25139de21ec96c
docker restart 653e41842aed205d3f18ef5b2be6816ab550eddea2161fb03f6168658c964545

...but I cant see the module deployed yet in my alfresco Smiley Sad

Try this project:

https://github.com/Alfresco/alfresco-docker-installer

This will generate a Docker Compose template ready to accept JAR or AMP packages to be deployed when starting.

Hyland Developer Evangelist

abhinavmishra14
World-Class Innovator
World-Class Innovator

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 :

image

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 :

image

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

Thancks in advance