在k8s中使用gradle构建java web项目镜像Dockerfile

FROM gradle:6-jdk8 AS build
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle build --no-daemon

FROM openjdk:8-jre-slim

EXPOSE 10010

RUN mkdir /app

COPY --from=build /home/gradle/src/build/libs/*.jar /app/website.jar

ENTRYPOINT ["java", "-jar","/app/wesite.jar"]
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐