使用环境变量 指定 docker for mac 适用 Rosetta
- DOCKER_DEFAULT_PLATFORM=linux/amd64
- 指定后 docker for mac 使用 Rosetta2
version: '3'
services:
mule-application:
environment:
- DOCKER_DEFAULT_PLATFORM=linux/amd64
container_name: mule-3.9.0-application
build:
context: .
dockerfile: Dockerfile
privileged: true
ports:
- "8081:8081"
# command: ["/bin/sh", "-c","sleep 30000000"]
dockerfile 使用 x86-64 amd64
- --platform=linux/amd64
FROM --platform=linux/amd64 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 -B package
RUN mv /app/target/gsb-1.0.0-SNAPSHOT.zip /apps/mule-standalone-3.9.0-20210217/apps
FROM --platform=linux/amd64 openjdk:8
ENV TZ=Asia/Shanghai
WORKDIR /app
COPY --from=TEMP_BUILD_IMAGE /apps/mule-standalone-3.9.0-20210217 .
EXPOSE 8000
ENTRYPOINT ["/app/bin/mule"]
标签:RUN,apple,--,mule,mac,3.9,amd64
From: https://www.cnblogs.com/guanchaoguo/p/17534527.html