docker / docs

Source repo for Docker's Documentation
https://docs.docker.com
Apache License 2.0
4.16k stars 7.26k forks source link

Example command for building multi-platform appears to be incorrect #21033

Closed switt4 closed 1 month ago

switt4 commented 1 month ago

Is this a docs issue?

Type of issue

Information is incorrect

Description

Under the "Build multi-platform images" sub-section in this page, the example command for building containers for multiple platforms appears to be incorrect:

This is what is in the documenation: docker build --platform linux/amd64,linux/arm64 .

This command gives this error:

ERROR: "docker buildx build" requires exactly 1 argument.
See 'docker buildx build --help'.

Usage:  docker buildx build [OPTIONS] PATH | URL | -

Start a build

Should this example command be: docker buildx build --platform linux/amd64,linux/arm64?

Thanks.

Location

https://docs.docker.com/build/building/multi-platform/#build-multi-platform-images

Suggestion

It appears as if the buildx option is missing from this example command. So, updating it to: docker buildx build --platform linux/amd64,linux/arm64 should fix the error in the documentation.

dvdksn commented 1 month ago

docker build is an alias for docker buildx build. Both require a positional argument. In this example, that's ., declaring the build context to use. Unfortunately it's easy to miss a . in an example command. We could change it to something like docker build [OPTIONS...] CONTEXT, but 9 times out of 10 that's ., and it's what we usually use as an example.

docker-robot[bot] commented 2 days ago

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

/lifecycle locked