Skip to content

Instantly share code, notes, and snippets.

@enesusta
Created April 18, 2021 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enesusta/0dd9b448560ce75780f19644f1a58f13 to your computer and use it in GitHub Desktop.
Save enesusta/0dd9b448560ce75780f19644f1a58f13 to your computer and use it in GitHub Desktop.
jdk11 dockerfile
FROM adoptopenjdk/openjdk11-openj9:x86_64-alpine-jdk11u-nightly-slim as build
ENV MAVEN_VERSION 3.5.4
ENV MAVEN_HOME /usr/lib/mvn
ENV PATH $MAVEN_HOME/bin:$PATH
COPY ./ ./
RUN apk add wget
RUN wget http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz && \
tar -zxvf apache-maven-$MAVEN_VERSION-bin.tar.gz && \
rm apache-maven-$MAVEN_VERSION-bin.tar.gz && \
mv apache-maven-$MAVEN_VERSION /usr/lib/mvn
RUN mvn clean install -DskipTests=true
FROM adoptopenjdk/openjdk11-openj9:x86_64-alpine-jre11u-nightly
EXPOSE 8080
ENV TZ=Europe/Istanbul
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV JAVA_OPTS ""
COPY --from=build any.jar any.jar
CMD ["java", "jar", "any.jar"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment