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

Time:10-14

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?

CodePudding user response:

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
  • Related