-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify Dockerfile and move graalvm build to separate file
- Loading branch information
Showing
2 changed files
with
37 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,15 @@ | ||
# this dockerfile and the associated compilation steps are | ||
# highly inspired by babashka's compilation process. | ||
# | ||
# See below for more details: | ||
# https://github.com/babashka/babashka | ||
FROM clojure:openjdk-11-lein-2.9.6-bullseye AS BASE | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt update | ||
RUN apt install --no-install-recommends -yy curl unzip build-essential zlib1g-dev sudo | ||
WORKDIR "/opt" | ||
RUN curl -sLO https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.1.0/graalvm-ce-java11-linux-amd64-21.1.0.tar.gz | ||
RUN tar -xzf graalvm-ce-java11-linux-amd64-21.1.0.tar.gz | ||
FROM ubuntu:latest | ||
WORKDIR /app | ||
|
||
ENV GRAALVM_HOME="/opt/graalvm-ce-java11-21.1.0" | ||
ENV JAVA_HOME="/opt/graalvm-ce-java11-21.1.0/bin" | ||
ENV PATH="$JAVA_HOME:$PATH" | ||
ENV IS_STATIC="true" | ||
ENV USE_MUSL="true" | ||
RUN apt update && \ | ||
apt install --no-install-recommends -yy curl unzip ca-certificates | ||
|
||
COPY . . | ||
RUN ./script/setup-musl | ||
RUN ./script/uberjar | ||
RUN ./script/compile | ||
ARG LH_VERSION | ||
RUN test -n "$LH_VERSION" && \ | ||
curl -sLO https://github.com/barracudanetworks/lighthouse/releases/download/$LH_VERSION/lighthouse-native-linux-amd64.zip && \ | ||
unzip lighthouse-native-linux-amd64.zip && \ | ||
mv lh /usr/local/bin && \ | ||
rm lighthouse-native-linux-amd64.zip | ||
|
||
FROM ubuntu:latest | ||
COPY --from=BASE /opt/lh /usr/local/bin/lh | ||
ENTRYPOINT ["lh"] | ||
CMD ["--help"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# this dockerfile and the associated compilation steps are | ||
# highly inspired by babashka's compilation process. | ||
# | ||
# See below for more details: | ||
# https://github.com/babashka/babashka | ||
FROM clojure:openjdk-11-lein-2.9.6-bullseye AS BASE | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt update | ||
RUN apt install --no-install-recommends -yy curl unzip build-essential zlib1g-dev sudo | ||
WORKDIR "/opt" | ||
RUN curl -sLO https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.1.0/graalvm-ce-java11-linux-amd64-21.1.0.tar.gz | ||
RUN tar -xzf graalvm-ce-java11-linux-amd64-21.1.0.tar.gz | ||
|
||
ENV GRAALVM_HOME="/opt/graalvm-ce-java11-21.1.0" | ||
ENV JAVA_HOME="/opt/graalvm-ce-java11-21.1.0/bin" | ||
ENV PATH="$JAVA_HOME:$PATH" | ||
ENV IS_STATIC="true" | ||
|
||
COPY . . | ||
RUN ./script/uberjar | ||
RUN ./script/compile | ||
|
||
FROM ubuntu:latest | ||
COPY --from=BASE /opt/lh /usr/local/bin/lh | ||
ENTRYPOINT ["lh"] | ||
CMD ["--help"] |