Code: Select all
FROM alpine:20250108
COPY jdk-22.0.1_linux-x64_bin.tar.gz /tmp/
RUN mkdir -p /usr/lib/jvm/java-22 && \
tar -xzf /tmp/jdk-22.0.1_linux-x64_bin.tar.gz -C /usr/lib/jvm/java-22 --strip-components=1 && \
chmod -R +x /usr/lib/jvm/java-22/bin && \
rm /tmp/jdk-22.0.1_linux-x64_bin.tar.gz
ENV JAVA_HOME=/usr/lib/jvm/java-22
ENV PATH="${JAVA_HOME}/bin/:${PATH}"
WORKDIR /app
COPY Main.java .
RUN java --version
# it fails here on this line
CMD ["java", "Main.java"]
< /code>
Aber die Sache ist, ich kann Java nicht richtig hinzufügen.glibc@2.35-r1
[*] Schreiben in/etc/profil
[*] Schreiben in/etc/profil2
[*]
Code: Select all
source
Code: Select all
su
Code: Select all
export
[*]
Code: Select all
workdir
Aber nichts funktioniert. Ich habe auch vielen Stackoverflow -Artikeln gefolgt, und es scheint nicht zu funktionieren. Wie dieses: < /p>
So installieren Sie sich in Alpine Linux < /li>
< /ul>
Und dieser spezifische Teer können wir aus dem folgenden Link heruntergeladen. Ich benutze WGet nicht, um ihre Site nicht zu spam.>