Skip to content

Commit

Permalink
build: docker support gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
damingerdai committed Nov 23, 2021
1 parent a49c6a9 commit f151091
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM maven:3.6.3-openjdk-15 AS builder
FROM gradle:7.3.0-jdk17-alpine AS builder
COPY src /usr/src/app/src
COPY pom.xml /usr/src/app
RUN mvn -f /usr/src/app/pom.xml clean package -Pdev -Dmaven.test.skip=true -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true

FROM adoptopenjdk/openjdk15:jre-15.0.1_9
COPY *.gradle /usr/src/app
RUN gradle build -x test --project-dir /usr/src/app
FROM openjdk:17.0.1-jdk-oracle
WORKDIR /app
COPY --from=builder /usr/src/app/target/*.jar /app/app.jar
COPY --from=builder /usr/src/app/build/libs/*.jar /app/app.jar
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
EXPOSE 3281
Expand Down

0 comments on commit f151091

Please sign in to comment.