update dockerfile

This commit is contained in:
Xander 2023-11-20 17:34:07 +01:00
parent a70521d6be
commit b1040ae0c5
No known key found for this signature in database
GPG key ID: 79979C7BA303E003

View file

@ -1,5 +1,22 @@
FROM amazoncorretto:21
WORKDIR /app
FROM alpine:latest as builder
RUN sed -i s/v3.18/edge/ /etc/apk/repositories
RUN apk upgrade --no-cache
RUN apk --no-cache add openjdk20
WORKDIR /workdir
COPY . .
RUN javac -cp .:lib/gson-2.10.1.jar ./planetwars/*.java Example.java
CMD java -cp .:lib/gson-2.10.1.jar Example
FROM alpine:latest
RUN sed -i s/v3.18/edge/ /etc/apk/repositories
RUN apk --no-cache add openjdk20-jre
RUN apk upgrade --no-cache
WORKDIR /workdir
COPY --from=builder /workdir /workdir
CMD java -cp .:lib/gson-2.10.1.jar Example