Skip to content

Latest commit

 

History

History
47 lines (37 loc) · 2.12 KB

create-custom-image.md

File metadata and controls

47 lines (37 loc) · 2.12 KB

How to create customized Docker images using this project

WARNING

The recommended way of building extensions is to use Rest APIs. The AMP extension mechanism may be replaced in the future.

Applying a custom AMP

This project uses fabric8 maven plugin to build and push the Alfresco Docker image. The plugin's configuration is stored in this pom.xml. The following example will illustrate how an additional AMP can be added in the configuration.

Prerequisites

  • The extension is packaged inside an AMP and can be accessed by Maven
  • Java
  • Maven
  • Docker
  • Access to Docker registry where the new Docker image will be pushed

Modifications to pom.xml

  • Add a dependency:
<dependency>
    <groupId>org.alfresco.integrations</groupId>
    <artifactId>alfresco-s3-connector</artifactId>
    <version>2.2.0</version>
    <type>amp</type>
</dependency>
  • Extend the copy-resources-amps execution of the maven-dependency-plugin in the same file by adding an artifact:
<artifactItem>
    <groupId>org.alfresco.integrations</groupId>
    <artifactId>alfresco-s3-connector</artifactId>
    <type>amp</type>
    <overWrite>false</overWrite>
    <outputDirectory>${project.build.directory}/amps</outputDirectory>
</artifactItem>

Maven will use maven-dependency-plugin to download the AMP from Maven repository and copy it into target/amps folder.

  • Trigger a Maven build and specify the image name and it's storage location:
mvn clean install -Ppush-docker-images -Dimage.name=mycompany/alfresco-with-s3 -Dimage.tag=latest -Dimage.registry=quay.io

The internal profile configures docker-maven-plugin to build and push an image. It will use this Dockerfile. All the AMPs from the target/amps folder are copied inside the image and then the amps are applied to the standard alfresco.war using MMT tool. After that the image is pushed to the specified Docker registry.