![](/img/trans.png)
[英]Docker / Buildx Use Multiple Architectures in Different Stages of Multi-Stage Dockerfile
[英]docker buildx - how to use different Dockerfile or switch in one
我必須使用兩種不同的 Dockerfile,或者一種(如果可以在平台上切換),另一種是:
更新:我已接受@SamBos 的回答,但會補充; 如果您希望兩個 Dockerfile 在同一個 ref 中,您需要創建自己的清單。 標簽(清單)
RUN curl -LO https://...amd64
和一個
RUN curl -LO https://...arm64
我怎樣才能使用 docker buildx 成為一個清單?
您可以將平台作為ARG
添加到您的Dockerfile
:
ARG PLATFORM=defaultplatform
RUN curl -LO https://...${PLATFORM}
然后從docker build
設置:
docker build --build-arg PLATFORM=arm64
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.