Skip to content

Multi-arch build using --platform and --build-arg #922

@yellowmamba

Description

@yellowmamba

Hi there,

I'm having some confusion around using --build-arg in conjunction with --platform. Here's an example of Dockerfile

ARG ARCH
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-${ARCH}.zip" -o "awscliv2.zip" \

When I build for amd64 and arm64, I do this

docker buildx build --platform=linux/amd64,linux/arm64 --build-arg ARCH=x86_64,aarch64 -t my-multi-arch-image .

The result of the curl command is either platform is

RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64,aarch64.zip" -o "awscliv2.zip"

According to docs,

--build-arg stringArray
--platform stringArray

I thought they both use comma-separated syntax, am I understanding it incorrectly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions