Skip to content

Commit

Permalink
OPSEXP-2725 Add T-Engine LibreOffice image Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pmacius committed Jul 29, 2024
1 parent 312f407 commit 395e0a6
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 2 deletions.
34 changes: 33 additions & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group "default" {
targets = ["content_service", "enterprise-search", "ats"]
targets = ["content_service", "enterprise-search", "ats", "tengines"]
}

group "content_service" {
Expand All @@ -14,6 +14,10 @@ group "ats" {
targets = ["ats_trouter", "ats_sfs"]
}

group "tengines" {
targets = ["tengine_libreoffice"]
}

variable "LABEL_VENDOR" {
default = "Hyland Software, Inc."
}
Expand Down Expand Up @@ -272,3 +276,31 @@ target "ats_sfs" {
tags = ["localhost/alfresco-shared-file-store:latest"]
output = ["type=docker"]
}

variable "ALFRESCO_LIBREOFFICE_USER_NAME" {
default = "libreoffice"
}

variable "ALFRESCO_LIBREOFFICE_USER_ID" {
default = "33002"
}

target "tengine_libreoffice" {
dockerfile = "./tengine/libreoffice/Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
}
args = {
ALFRESCO_LIBREOFFICE_GROUP_NAME = "${ALFRESCO_GROUP_NAME}"
ALFRESCO_LIBREOFFICE_GROUP_ID = "${ALFRESCO_GROUP_ID}"
ALFRESCO_LIBREOFFICE_USER_NAME = "${ALFRESCO_LIBREOFFICE_USER_NAME}"
ALFRESCO_LIBREOFFICE_USER_ID = "${ALFRESCO_LIBREOFFICE_USER_ID}"
}
labels = {
"org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine LibreOffice"
"org.opencontainers.image.description" = "Alfresco Transform Engine LibreOffice"
}
tags = ["localhost/alfresco-libreoffice:latest"]
output = ["type=docker"]
}
2 changes: 1 addition & 1 deletion scripts/fetch-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ for i in $(find . -name artifacts.json -mindepth 2); do
ARTIFACT_EXT=$(jq -r ".artifacts.acs${INDEX_KEY}[$j].classifier" $i)
ARTIFACT_GROUP=$(jq -r ".artifacts.acs${INDEX_KEY}[$j].group" $i)
ARTIFACT_PATH=$(jq -r ".artifacts.acs${INDEX_KEY}[$j].path" $i)
ARTIFACT_BASEURL="https://nexus.alfresco.com/nexus/service/local/repositories/${ARTIFACT_REPO}"
ARTIFACT_BASEURL="https://nexus.alfresco.com/nexus/service/local/repository/${ARTIFACT_REPO}"
echo "Downloading $ARTIFACT_GROUP:$ARTIFACT_NAME $ARTIFACT_VERSION from $ARTIFACT_BASEURL"
wget "${ARTIFACT_BASEURL}/${ARTIFACT_GROUP//\./\/}/${ARTIFACT_NAME}/${ARTIFACT_VERSION}/${ARTIFACT_NAME}-${ARTIFACT_VERSION}${ARTIFACT_EXT}" \
-O ${ARTIFACT_PATH}/${ARTIFACT_NAME}-${ARTIFACT_VERSION}${ARTIFACT_EXT}
Expand Down
32 changes: 32 additions & 0 deletions tengine/libreoffice/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM java_base

EXPOSE 8090

ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80
ENV LIBREOFFICE_COMMON_PATH=tengine/libreoffice

ARG ALFRESCO_LIBREOFFICE_GROUP_NAME
ARG ALFRESCO_LIBREOFFICE_GROUP_ID
ARG ALFRESCO_LIBREOFFICE_USER_NAME
ARG ALFRESCO_LIBREOFFICE_USER_ID

ADD ${LIBREOFFICE_COMMON_PATH}/alfresco-transform-libreoffice*.jar /usr/bin/app.jar
ADD ${LIBREOFFICE_COMMON_PATH}/libreoffice-dist*.gz libreoffice-dist.gz

RUN yum install -y cairo cups-libs libSM libGLU && \
tar xzf libreoffice-dist-linux.gz && \
yum localinstall -y LibreOffice*/RPMS/*.rpm && \
rm -rf libreoffice-dist-linux.gz LibreOffice_*_Linux_x86-64_rpm; \
yum clean all

RUN groupadd -g ${ALFRESCO_LIBREOFFICE_GROUP_ID} ${ALFRESCO_LIBREOFFICE_GROUP_NAME} && \
useradd -u ${ALFRESCO_IMAGEMAGICK_USER_ID} -g ${ALFRESCO_LIBREOFFICE_GROUP_NAME} ${ALFRESCO_LIBREOFFICE_USER_NAME} && \
chgrp ${ALFRESCO_LIBREOFFICE_GROUP_NAME} /usr/bin/app.jar

USER ${ALFRESCO_LIBREOFFICE_USER_NAME}

HEALTHCHECK --interval=20s --timeout=10s --retries=3 --start-period=30s \
CMD curl -f http://localhost:8090/live || exit 1

COPY ${LIBREOFFICE_COMMON_PATH}/entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
22 changes: 22 additions & 0 deletions tengine/libreoffice/artifacts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"artifacts": {
"acs23": [
{
"name": "libreoffice-dist",
"version": "7.2.5",
"path": "tengine/libreoffice",
"classifier": "-linux.gz",
"repository": "thirdparty",
"group": "org.libreoffice"
},
{
"name": "alfresco-transform-libreoffice",
"version": "5.1.3",
"path": "tengine/libreoffice",
"classifier": ".jar",
"repository": "releases",
"group": "org.alfresco"
}
]
}
}
2 changes: 2 additions & 0 deletions tengine/libreoffice/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
exec java $JAVA_OPTS $JAVA_OPTS_CONTAINER_FLAGS -jar /opt/app.jar

0 comments on commit 395e0a6

Please sign in to comment.