From 2ebd05c18499136a2556ebc193ccfa12a1f1fb22 Mon Sep 17 00:00:00 2001 From: pmacius Date: Fri, 26 Jul 2024 13:32:55 +0200 Subject: [PATCH] OPSEXP-2724 Add T-Engine ImageMagick image Dockefile --- docker-bake.hcl | 42 +++++++++++++++++++++++++++++- tengine/README.md | 20 ++++++++++++++ tengine/imagemagick/Dockerfile | 30 +++++++++++++++++++++ tengine/imagemagick/artifacts.json | 30 +++++++++++++++++++++ tengine/imagemagick/entrypoint.sh | 3 +++ 5 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 tengine/README.md create mode 100644 tengine/imagemagick/Dockerfile create mode 100644 tengine/imagemagick/artifacts.json create mode 100755 tengine/imagemagick/entrypoint.sh diff --git a/docker-bake.hcl b/docker-bake.hcl index af80712e..750af5e2 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,5 +1,5 @@ group "default" { - targets = ["content_service", "enterprise-search", "ats"] + targets = ["content_service", "enterprise-search", "ats", "tengine"] } group "content_service" { @@ -14,6 +14,10 @@ group "ats" { targets = ["ats_trouter"] } +group "tengine" { + targets = ["tengine_imagemagick"] +} + variable "LABEL_VENDOR" { default = "Hyland Software, Inc." } @@ -252,3 +256,39 @@ target "ats_trouter" { tags = ["localhost/alfresco-transform-router:latest"] output = ["type=docker"] } + +variable "ALFRESCO_IMAGEMAGICK_GROUP_NAME" { + default = "Alfresco" +} + +variable "ALFRESCO_IMAGEMAGICK_GROUP_ID" { + default = "1000" +} + +variable "ALFRESCO_IMAGEMAGICK_USER_NAME" { + default = "imagemagick" +} + +variable "ALFRESCO_IMAGEMAGICK_USER_ID" { + default = "33002" +} + +target "tengine_imagemagick" { + dockerfile = "./tengine/imagemagick/Dockerfile" + inherits = ["java_base"] + contexts = { + java_base = "target:java_base" + } + args = { + ALFRESCO_TROUTER_GROUP_NAME = "${ALFRESCO_TROUTER_GROUP_NAME}" + ALFRESCO_TROUTER_GROUP_ID = "${ALFRESCO_TROUTER_GROUP_ID}" + ALFRESCO_TROUTER_USER_NAME = "${ALFRESCO_TROUTER_USER_NAME}" + ALFRESCO_TROUTER_USER_ID = "${ALFRESCO_TROUTER_USER_ID}" + } + labels = { + "org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine Imagemagick" + "org.opencontainers.image.description" = "Alfresco Transform Engine Imagemagick" + } + tags = ["localhost/alfresco-imagemagick:latest"] + output = ["type=docker"] +} diff --git a/tengine/README.md b/tengine/README.md new file mode 100644 index 00000000..db161058 --- /dev/null +++ b/tengine/README.md @@ -0,0 +1,20 @@ +# Runtime variables + +Sets of variables configurable with your docker image + +## imagemagick + +```yaml + +transform-core-imagemagick: + image: localhost/alfresco-imagemagick:YOUR-TAG + environment: + JAVA_OPTS: + ACTIVEMQ_URL: nio://activemq:61616 + FILE_STORE_URL: http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file + +``` + +- `JAVA_OPTS` - Additional java options +- `ACTIVEMQ_URL` - The URL for Alfresco ActiveMQ. +- `FILE_STORE_URL` - Alfresco Shared FileStore endpoint. diff --git a/tengine/imagemagick/Dockerfile b/tengine/imagemagick/Dockerfile new file mode 100644 index 00000000..582a9920 --- /dev/null +++ b/tengine/imagemagick/Dockerfile @@ -0,0 +1,30 @@ +FROM java_base + +EXPOSE 8090 + +ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80 +ENV IMAGEMAGICK_DEP_RPM_URL=https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm +ENV IMAGEMAGICK_RPM_PATH=tengine/imagemagick/imagemagick-distribution + +ARG ALFRESCO_IMAGEMAGICK_GROUP_NAME +ARG ALFRESCO_IMAGEMAGICK_GROUP_ID +ARG ALFRESCO_IMAGEMAGICK_USER_NAME +ARG ALFRESCO_IMAGEMAGICK_USER_ID + +ADD tengine/imagemagick/alfresco-transform-imagemagick*.jar /usr/bin/app.jar + +RUN yum install -y $IMAGEMAGICK_DEP_RPM_URL && \ + yum install -y ${IMAGEMAGICK_RPM_PATH}*-el8.rpm ${IMAGEMAGICK_RPM_PATH}*-el8-libs.rpm; \ + yum clean all + +RUN groupadd -g ${ALFRESCO_IMAGEMAGICK_GROUP_ID} ${ALFRESCO_IMAGEMAGICK_GROUP_NAME} && \ + useradd -u ${ALFRESCO_IMAGEMAGICK_USER_ID} -G ${ALFRESCO_IMAGEMAGICK_GROUP_NAME} ${ALFRESCO_IMAGEMAGICK_USER_NAME} && \ + chgrp ${ALFRESCO_IMAGEMAGICK_GROUP_NAME} /usr/bin/app.jar + +USER ${ALFRESCO_IMAGEMAGICK_USER_NAME} + +HEALTHCHECK --interval=20s --timeout=10s --retries=3 --start-period=30s \ + CMD curl -f http://localhost:8090/live || exit 1 + +COPY tengine/imagemagick/entrypoint.sh /entrypoint.sh +CMD ["/entrypoint.sh"] diff --git a/tengine/imagemagick/artifacts.json b/tengine/imagemagick/artifacts.json new file mode 100644 index 00000000..08b01206 --- /dev/null +++ b/tengine/imagemagick/artifacts.json @@ -0,0 +1,30 @@ +{ + "artifacts": { + "acs23": [ + { + "name": "imagemagick-distribution", + "version": "7.1.0-16-ci-10", + "path": "tengine/imagemagick", + "classifier": "-el8-libs.rpm", + "repository": "thirdparty", + "group": "org.imagemagick" + }, + { + "name": "imagemagick-distribution", + "version": "7.1.0-16-ci-7", + "path": "tengine/imagemagick", + "classifier": "-el8.rpm", + "repository": "thirdparty", + "group": "org.imagemagick" + }, + { + "name": "alfresco-transform-imagemagick", + "version": "5.1.3", + "path": "tengine/imagemagick", + "classifier": ".jar", + "repository": "releases", + "group": "org.alfresco" + } + ] + } +} diff --git a/tengine/imagemagick/entrypoint.sh b/tengine/imagemagick/entrypoint.sh new file mode 100755 index 00000000..9837e5a3 --- /dev/null +++ b/tengine/imagemagick/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +exec java $JAVA_OPTS $JAVA_OPTS_CONTAINER_FLAGS -jar /usr/bin/app.jar