Skip to content

Commit 4ff051e

Browse files
fix path for jdk
Signed-off-by: stoneshi-yunify <[email protected]>
1 parent fc967a6 commit 4ff051e

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

java/images/ubuntu-java11/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM ubuntu:24.04
22

3+
ARG TARGETARCH
4+
35
ARG EXPOSE_PORT=8080
46
EXPOSE ${EXPOSE_PORT}
57

@@ -44,11 +46,12 @@ RUN apt-get update && \
4446
&& useradd -u 1001 -r -g jboss -m -d /opt/jboss -s /sbin/nologin -c "JBoss user" jboss \
4547
&& chmod 755 /opt/jboss
4648

47-
ENV JAVA_HOME /etc/alternatives/jre
49+
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-${TARGETARCH}
50+
ENV PATH=$PATH:${JAVA_HOME}/bin
4851

4952

5053
# Use /dev/urandom to speed up startups & Add jboss user to the root group
51-
RUN echo securerandom.source=file:/dev/urandom >> /usr/lib/jvm/java/conf/security/java.security \
54+
RUN echo securerandom.source=file:/dev/urandom >> /usr/lib/jvm/java-11-openjdk-${TARGETARCH}/conf/security/java.security \
5255
&& usermod -g root -G jboss jboss
5356

5457
# Prometheus JMX exporter agent

java/images/ubuntu/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM ubuntu:24.04
22

3+
ARG TARGETARCH
4+
35
ARG EXPOSE_PORT=8080
46
EXPOSE ${EXPOSE_PORT}
57

@@ -44,11 +46,11 @@ RUN apt-get update && \
4446
&& useradd -u 1001 -r -g jboss -m -d /opt/jboss -s /sbin/nologin -c "JBoss user" jboss \
4547
&& chmod 755 /opt/jboss
4648

47-
ENV JAVA_HOME /etc/alternatives/jre
48-
49+
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-${TARGETARCH}
50+
ENV PATH=$PATH:${JAVA_HOME}/bin
4951

5052
# Use /dev/urandom to speed up startups & Add jboss user to the root group
51-
RUN echo securerandom.source=file:/dev/urandom >> /usr/lib/jvm/java/jre/lib/security/java.security \
53+
RUN echo securerandom.source=file:/dev/urandom >> /usr/lib/jvm/java-8-openjdk-${TARGETARCH}/jre/lib/security/java.security \
5254
&& usermod -g root -G jboss jboss
5355

5456
# Prometheus JMX exporter agent

0 commit comments

Comments
 (0)