Skip to content

Commit

Permalink
Switch to Debian base for Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
SCadilhac committed Jan 14, 2024
1 parent 3f54579 commit 3fd4e66
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
ARG NETSHOT_VERSION=0.0.1-dev
ARG GRAALVM_VERSION=17.0.8

FROM ghcr.io/graalvm/graalvm-community:${GRAALVM_VERSION} AS builder
FROM debian:12 AS debian-graalvm
ARG GRAALVM_VERSION
RUN apt-get -y update && apt-get -y install wget
WORKDIR /usr/lib/jvm
RUN wget --quiet https://download.oracle.com/graalvm/${GRAALVM_VERSION%%.*}/archive/graalvm-jdk-${GRAALVM_VERSION}_linux-x64_bin.tar.gz && \
tar xvzf graalvm-jdk-${GRAALVM_VERSION}_linux-x64_bin.tar.gz && \
rm -f graalvm-jdk-${GRAALVM_VERSION}_linux-x64_bin.tar.gz && \
ln -sfn graalvm-jdk-${GRAALVM_VERSION}* graalvm && \
update-alternatives --install /usr/bin/java java /usr/lib/jvm/graalvm/bin/java 92100
RUN /usr/lib/jvm/graalvm/bin/gu install js python


FROM debian-graalvm AS builder
ARG NETSHOT_VERSION
RUN gu install js python
COPY . /build
WORKDIR /build
RUN echo $NE
Expand All @@ -12,10 +23,9 @@ RUN sed -i -r "s/VERSION = \".*\";/VERSION = \"$NETSHOT_VERSION\";/g" \
RUN ./mvnw package


FROM ghcr.io/graalvm/graalvm-community:${GRAALVM_VERSION}
RUN gu install js python
FROM debian-graalvm
RUN mkdir /usr/local/netshot /var/log/netshot
COPY --from=0 /build/target/netshot.jar /usr/local/netshot/netshot.jar
COPY --from=builder /build/target/netshot.jar /usr/local/netshot/netshot.jar
COPY dist/netshot.conf.docker /etc/netshot.conf
EXPOSE 8080
CMD ["/usr/bin/java", "-jar", "/usr/local/netshot/netshot.jar"]

0 comments on commit 3fd4e66

Please sign in to comment.