远程构建 dcokerfile
FROM openjdk:8-jdk-alpine as TEMP_BUILD_IMAGE
RUN set -eux && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk update && \
apk add --no-cache bash curl wget && \
apk add --no-cache maven
WORKDIR /app
COPY . .
RUN mvn -f pom-default.xml package -DskipTests &&\
ls target
FROM openjdk:8
WORKDIR /app/
COPY --from=TEMP_BUILD_IMAGE /app/target/dataExChangePlatform-0.0.1-SNAPSHOT.jar .
EXPOSE 8000
CMD ["java","-jar","dataExChangePlatform-0.0.1-SNAPSHOT.jar"]
docker-compose.yml
version: '3'
services:
spring-boot-application:
container_name: spring-boot-application
build:
context: .
dockerfile: Dockerfile
privileged: true
ports:
- "8000:8000"
logging:
driver: "json-file"
options:
max-size: "500m"
max-file: "3"
标签:web,RUN,app,kettle,jar,apk,&&,dockerfile
From: https://www.cnblogs.com/guanchaoguo/p/17457687.html