Skip to content

Commit

Permalink
ACS-5039 - Libreoffice home set by docker-entry point script
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekswieton committed Aug 2, 2023
1 parent 8f6ccc4 commit 9b35d32
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
4 changes: 3 additions & 1 deletion engines/aio/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,6 @@ EXPOSE 8090

USER ${AIOUSERNAME}

ENTRYPOINT ["/bin/sh", "-c", "if [[ \"$(uname -m)\" != \"x86_64\" ]]; then export LIBREOFFICE_HOME=${LIBREOFFICE_HOME:=/usr/lib64/libreoffice}; fi && java $JAVA_OPTS -jar /usr/bin/${env.project_artifactId}.jar"]
# Copy the script to set LIBREOFFICE_HOME
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh", "${env.project_artifactId}"]
9 changes: 9 additions & 0 deletions engines/aio/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# Check if the architecture is ARM64 (aarch64)
if [[ "$(uname -m)" != "x86_64" ]]; then
export LIBREOFFICE_HOME=${LIBREOFFICE_HOME:=/usr/lib64/libreoffice}
fi

# Run the Alfresco transformation service JAR file with the specified Java options
exec java $JAVA_OPTS -jar /usr/bin/${1}.jar "$@"
10 changes: 4 additions & 6 deletions engines/libreoffice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ ENV LIBREOFFICE_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositor
ENV LIBREOFFICE_ARM64_RPM_URL=https://dl.rockylinux.org/pub/rocky/8/Devel/aarch64/os/Packages/l/libreoffice-6.4.7.2-13.el8.aarch64.rpm
ENV JAVA_OPTS=""

# Copy the script to set LIBREOFFICE_HOME
COPY set_libreoffice_home.sh /set_libreoffice_home.sh

# Set default user information
ARG GROUPNAME=Alfresco
ARG GROUPID=1000
Expand All @@ -32,8 +29,7 @@ RUN ln /${env.project_artifactId}-${env.project_version}.jar /usr/bin/${env.proj
rm -rf libreoffice-dist-*linux.gz LibreOffice_*_Linux_x86-64_rpm; \
else \
dnf --enablerepo=devel install -y $LIBREOFFICE_ARM64_RPM_URL && \
update-alternatives --set java java-17-openjdk.aarch64 && \
. /set_libreoffice_home.sh; \
update-alternatives --set java java-17-openjdk.aarch64; \
fi && \
yum clean all

Expand All @@ -50,4 +46,6 @@ EXPOSE 8090

USER ${LIBREUSERNAME}

ENTRYPOINT java $JAVA_OPTS -jar /usr/bin/${env.project_artifactId}.jar
# Copy the script to set LIBREOFFICE_HOME
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh", "${env.project_artifactId}"]
9 changes: 9 additions & 0 deletions engines/libreoffice/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# Check if the architecture is ARM64 (aarch64)
if [[ "$(uname -m)" != "x86_64" ]]; then
export LIBREOFFICE_HOME=${LIBREOFFICE_HOME:=/usr/lib64/libreoffice}
fi

# Run the Alfresco transformation service JAR file with the specified Java options
exec java $JAVA_OPTS -jar /usr/bin/${1}.jar "$@"
3 changes: 0 additions & 3 deletions engines/libreoffice/set_libreoffice_home.sh

This file was deleted.

0 comments on commit 9b35d32

Please sign in to comment.