Skip to content

Documentation: multiple tags by simply using multiple --tag parameters #396

@jonstelly

Description

@jonstelly

I had cobbled together a build process using buildx where I ran buildx build ... --push twice (with different tags) so I could build and publish for multiple tags.

docker buildx build . --platform=linux/arm64,linux/amd64 --tag my/image:0.1 --pull --push --no-cache
docker buildx build . --platform=linux/arm64,linux/amd64 --tag my/image:latest

It didn't immediately jump out at me that the --tag parameter could be specified multiple times until I happened to see stringArray as the type for the --tag parameter. This lets me build and push to multiple tags in one step:

docker buildx build . --platform=linux/arm64,linux/amd64 --tag my/image:0.1 --tag my/image:latest --pull --push --no-cache

I'll try and find a minute to add this to the README.md and submit a PR in the next couple days but wanted to capture this as an issue to explain it first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions