update dockerfile
This commit is contained in:
parent
a70521d6be
commit
447d8e0f39
1 changed files with 20 additions and 3 deletions
|
@ -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
|
||||
|
||||
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
|
Loading…
Reference in a new issue