Files
alfresco-community-repo/packaging/docker-alfresco/pom.xml
Wojtek Świętoń 212fa9b362 ACS-4137 Produce Multi-Arch Docker images (#1656)
* ACS-4137 Update pom.xml to use buildx

* ACS-4137 Update travis.yml to use buildx

* ACS-4137 Update travis.yml to use buildx, newest docker version

* ACS-4137 reverted unnecessary changes in travis.yml file

* ACS-4137 Change deprecated <dockerFileDir> property to <contextDir>. Moved <build> section from subpoms to global pom.

* ACS-4137 POM indentation fixes

* ACS-4137 Fix building a multiarch image (#1697)

* ACS-4137 Test wih GHA [ags][tas]

* ACS-4137 Test wih GHA [ags][tas]

* ACS-4137 Fix setting network [ags][tas]

* ACS-4137 Fix creating builder [ags][tas]

* ACS-4137 Change image tag [ags][tas]

* ACS-4137 Fix starting the registry [ags][tas]

* ACS-4137 Refactor code [ags][tas]

* ACS-4137 Uncomment all jobs [tas][ags]

* ACS-4137 Improve prepare_buildx.sh [tas][ags]

* ACS-4137 Implement timeout + remove hardcoded base image tag [tas][ags]

* ACS-4137 Added exec-maven-plugin to build-push-image for alfresco-governance-repository-community-base image

* ACS-4137 Generalize prepare_buildx.sh + increase registry timeout

* ACS-4137 merged local.registry.host and local.registry.port. Builder name changed to entitled-builder. In prepare_builder script added localhost registry checking

* ACS-4137 added build-multiarch-docker-images maven profile

* ACS-4137 added <BASE_IMAGE> arg to build-docker-images profile

* ACS-4137 added combine.self="override" attribute to configuration in build-docker-images profile to not use buildx. Delete redundant base.image.tag

* ACS-4137 Push docker images to local repository

* ACS-4137 Remove useless scripts

* ACS-4137 Move builder.name and local.registry properties to main pom.xml

* ACS-4137 Remove useless properties definitions

---------

Co-authored-by: Damian.Ujma@hyland.com <Damian.Ujma@hyland.com>
Co-authored-by: Damian Ujma <92095156+damianujma@users.noreply.github.com>
2023-03-10 09:20:22 +01:00

252 lines
12 KiB
XML

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>alfresco-community-repo-docker</artifactId>
<name>Alfresco Community Repo Docker Base Builder</name>
<packaging>pom</packaging>
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>20.95-SNAPSHOT</version>
</parent>
<properties>
<image.name>alfresco/alfresco-community-repo-base</image.name>
<scripts.directory>${project.parent.parent.basedir}/scripts</scripts.directory>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-war-files</id>
<phase>process-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.alfresco</groupId>
<artifactId>content-services-community</artifactId>
<version>${project.version}</version>
<type>war</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/war/alfresco</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-server-root</artifactId>
<version>${dependency.alfresco-server-root.version}</version>
<type>war</type>
<outputDirectory>${project.build.directory}/war/ROOT</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.alfresco.aos-module</groupId>
<artifactId>alfresco-vti-bin</artifactId>
<type>war</type>
<outputDirectory>${project.build.directory}/war/_vti_bin</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<execution>
<id>copy-jdbc-connectors</id>
<phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/connector</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-mmt</artifactId>
<type>jar</type>
<version>${project.version}</version>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/alfresco-mmt</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<execution>
<id>copy-amps</id>
<phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.alfresco.aos-module</groupId>
<artifactId>alfresco-aos-module</artifactId>
<type>amp</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/amps</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.alfresco.integrations</groupId>
<artifactId>alfresco-googledrive-repo-community</artifactId>
<type>amp</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/amps</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<execution>
<id>unpack-licenses-and-keystore</id>
<phase>process-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-distribution</artifactId>
<type>jar</type>
<version>${project.version}</version>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>build-docker-images</id>
<!-- builds "image:latest" locally -->
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration combine.self="override">
<images>
<image>
<name>${image.name}:${image.tag}</name>
</image>
</images>
</configuration>
<executions>
<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>build-multiarch-docker-images</id>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<images>
<image>
<name>${local.registry}/${image.name}:${image.tag}</name>
<build>
<buildx>
<builderName>${builder.name}</builderName>
</buildx>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<id>build-push-image</id>
<phase>install</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<executions>
<execution>
<id>prepare-buildx</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${scripts.directory}/prepare_buildx.sh</executable>
<arguments>
<argument>${builder.name}</argument>
<argument>${image.registry}</argument>
<argument>${image.name}</argument>
<argument>${image.tag}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>push-docker-images</id>
<!-- publishes "image:latest" on Quay & DockerHub -->
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<images>
<!-- Quay image -->
<image>
<name>${image.registry}/${image.name}:${image.tag}</name>
</image>
<!-- DockerHub image -->
<image>
<name>${image.name}:${image.tag}</name>
</image>
</images>
</configuration>
<executions>
<execution>
<id>build-push-image</id>
<phase>install</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>