update dockerfile
This commit is contained in:
parent
a70521d6be
commit
b1040ae0c5
1 changed files with 20 additions and 3 deletions
|
@ -1,5 +1,22 @@
|
||||||
FROM amazoncorretto:21
|
FROM alpine:latest as builder
|
||||||
WORKDIR /app
|
RUN sed -i s/v3.18/edge/ /etc/apk/repositories
|
||||||
|
|
||||||
|
RUN apk upgrade --no-cache
|
||||||
|
RUN apk --no-cache add openjdk20
|
||||||
|
|
||||||
|
WORKDIR /workdir
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN javac -cp .:lib/gson-2.10.1.jar ./planetwars/*.java Example.java
|
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
|
CMD java -cp .:lib/gson-2.10.1.jar Example
|
Loading…
Reference in a new issue