简体   繁体   中英

docker buildx - how to use different Dockerfile or switch in one

I have to use two different Dockerfiles, or one if it is possible to switch on platform, one where it:

Update: I have accepted @SamBos answer, but will add; you need to create you own manifest if you want both Dockerfiles in the same ref. tag(manifest)

RUN curl -LO https://...amd64

and one where it

RUN curl -LO https://...arm64

How can I do that using docker buildx to become one manifest?

You coudl add platform as an ARG to your Dockerfile :

ARG PLATFORM=defaultplatform
RUN curl -LO https://...${PLATFORM}

and then set that from docker build :

docker build --build-arg PLATFORM=arm64

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM