dockerfile
FROM openjdk:8-jdk-alpine as TEMP_BUILD_IMAGE
WORKDIR /apps/
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
RUN wget https://repository.mulesoft.org/nexus/content/repositories/releases/org/mule/distributions/mule-standalone/3.9.0-20210217/mule-standalone-3.9.0-20210217.tar.gz
RUN tar -zxvf mule-standalone-3.9.0-20210217.tar.gz
WORKDIR /app
COPY src src
COPY pom.xml pom.xml
RUN mvn clean install || return 0
RUN mvn install || return 0
RUN mvn -B package
RUN mv /app/target/gsb-1.0.0-SNAPSHOT.zip /apps/mule-standalone-3.9.0-20210217/apps
FROM openjdk:8
ENV TZ=Asia/Shanghai
WORKDIR /app
COPY --from=TEMP_BUILD_IMAGE /apps/mule-standalone-3.9.0-20210217 .
EXPOSE 8000
CMD ["/apps/mule-standalone-3.9.0-20210217/bin/mule"]
docker-compose
version: '3'
services:
mule-application:
container_name: mule-3.9.0-application
build:
context: .
dockerfile: Dockerfile
privileged: true
ports:
- "8081:8081"
# command: ["/bin/sh", "-c","sleep 30000000"]
标签:RUN,standalone,app,mule,20210217,dockerfile,mvn,3.9
From: https://www.cnblogs.com/guanchaoguo/p/17502258.html