Create custom repository image - Alfresco Content Services - 23.4 - 23.4 - Ready - Alfresco - external

Alfresco Content Services

Platform
Alfresco
Product
Alfresco Content Services
Release
23.4
License

You now need to install the AMP files into the Alfresco Content Repository image.

  1. The docker-compose folder contains a file for each main code line of Content Services. Examine the relevant Docker Compose file for the version you want to apply the AMPs to.
    For example, to apply AMPs to the latest version of 7.4, take a look at the docker-compose.yml file.
  2. Take note of the image and tag used for the alfresco service in the Docker Compose file you chose.
    For example, if you’re using docker-compose.yml, you’ll find on line 15:
     quay.io/alfresco/alfresco-content-repository:7.4.0
    
  3. Add the following Docker commands to the repository/Dockerfile file and save it. Make sure that you change the image name and tag to match the above step:
     FROM quay.io/alfresco/alfresco-content-repository:7.4.0
    
     # Customize container: install amps
    
     ARG ALF_GROUP=Alfresco
     ARG TOMCAT_DIR=/usr/local/tomcat
    
     USER root
    
     ADD ./amps/*.amp ${TOMCAT_DIR}/amps/
    
     RUN java -jar ${TOMCAT_DIR}/alfresco-mmt/alfresco-mmt*.jar install \
         ${TOMCAT_DIR}/amps ${TOMCAT_DIR}/webapps/alfresco -directory -nobackup -verbose
    
     # Restore permissions
     RUN chgrp -R ${ALF_GROUP} ${TOMCAT_DIR}/webapps && \
         find ${TOMCAT_DIR}/webapps -type d -exec chmod 0750 {} \; && \
         find ${TOMCAT_DIR}/webapps -type f -exec chmod 0640 {} \; && \
         find ${TOMCAT_DIR}/shared -type d -exec chmod 0750 {} \; && \
         find ${TOMCAT_DIR}/shared -type f -exec chmod 0640 {} \; && \
         chmod -R g+r ${TOMCAT_DIR}/webapps && \
         chgrp -R ${ALF_GROUP} ${TOMCAT_DIR}
    
     USER alfresco
    
    Note: In the example RUN Docker command, the Alfresco MMT JAR is run with -directory, -nobackup and -verbose options. Make sure these options are suitable for your requirements. See the Using the Module Management Tool (MMT) for more.
  4. Build the image, making sure you give the image an appropriate name and tag, so you can easily identify it later.
    In the example, replace myregistrydomain/my-custom-alfresco-content-repository:7.4 and myregistrydomain/my-custom-alfresco-content-repository:latest with your own Docker registry, image name, and tag:
     docker build repository -t myregistrydomain/my-custom-alfresco-content-repository:23.1 -t myregistrydomain/my-custom-alfresco-content-repository:latest
    

    Once the image build is complete, you should see success messages:

     Successfully built 632eda3ea296
     Successfully tagged myregistrydomain/my-custom-alfresco-content-repository:7.4
     Successfully tagged myregistrydomain/my-custom-alfresco-content-repository:latest
    
  5. Replace the image used by the alfresco service in the Docker Compose file you chose in step 1.
    For example, replace image: quay.io/alfresco/alfresco-content-repository:7.4.0 with image: myregistrydomain/my-custom-alfresco-content-repository:7.4:
  6. Save the file.