Skip to content

Commit 3e3e2ce

Browse files
authored
Merge pull request #2 from odidev/patch-1
Add support for other architecture than AMD64: ARM64 architecture. This PR gives this possibility. For instance, ARM64 isn't officially adopted by our team but anyone interested to build and to run Silverpeas for ARM64 architecture can do it now thanks to this PR Thank odidev for your work.
2 parents 4a798d5 + e80a605 commit 3e3e2ce

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

Dockerfile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,21 @@ ENV LC_ALL ${DEFAULT_LOCALE}
6060
# Install Silverpeas and Wildfly
6161
#
6262

63+
# add a simple script that can auto-detect the appropriate JAVA_HOME value
64+
# based on whether the JDK or only the JRE is installed
65+
RUN { \
66+
echo '#!/bin/sh'; \
67+
echo 'set -e'; \
68+
echo; \
69+
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
70+
} > /usr/local/bin/docker-java-home \
71+
&& chmod +x /usr/local/bin/docker-java-home
72+
73+
# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe
74+
RUN ln -svT "/usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)" /docker-java-home
75+
6376
# Set up environment variables for Silverpeas
64-
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
77+
ENV JAVA_HOME /docker-java-home
6578
ENV SILVERPEAS_HOME /opt/silverpeas
6679
ENV JBOSS_HOME /opt/wildfly
6780

Dockerfile.template

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,21 @@ ENV LC_ALL ${DEFAULT_LOCALE}
6060
# Install Silverpeas and Wildfly
6161
#
6262

63+
# add a simple script that can auto-detect the appropriate JAVA_HOME value
64+
# based on whether the JDK or only the JRE is installed
65+
RUN { \
66+
echo '#!/bin/sh'; \
67+
echo 'set -e'; \
68+
echo; \
69+
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
70+
} > /usr/local/bin/docker-java-home \
71+
&& chmod +x /usr/local/bin/docker-java-home
72+
73+
# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe
74+
RUN ln -svT "/usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)" /docker-java-home
75+
6376
# Set up environment variables for Silverpeas
64-
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
77+
ENV JAVA_HOME /docker-java-home
6578
ENV SILVERPEAS_HOME /opt/silverpeas
6679
ENV JBOSS_HOME /opt/wildfly
6780

0 commit comments

Comments
 (0)