Skip to content

Instantly share code, notes, and snippets.

@ahndmal
Created November 8, 2021 12:18
Show Gist options
  • Save ahndmal/eafb25cf17d2083645362034a0f6147c to your computer and use it in GitHub Desktop.
Save ahndmal/eafb25cf17d2083645362034a0f6147c to your computer and use it in GitHub Desktop.
#
# Create a custom JLink runtime
#
FROM adoptopenjdk:16 AS builder
RUN cd /usr/local && \
curl -O https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz && \
tar xfvz apache-maven-3.6.3-bin.tar.gz && \
rm apache-maven-3.6.3-bin.tar.gz
COPY . /root
RUN export PATH=$PATH:/usr/local/apache-maven-3.6.3/bin && \
cd /root && \
mvn --no-transfer-progress clean install
#
# Create a slim Debian image with the custom JLink runtime
#
FROM debian:10-slim
COPY --from=builder /root/target/jlink /usr/local/helloworld
EXPOSE 8080
CMD ["/usr/local/helloworld/bin/helloworld"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment