docker-buildx-build
Build an image from a Dockerfile using the BuildKit engine. tldr-pages
On several platforms
Several platforms
Build an image from the Dockerfile in the current directory
docker buildx build .IdentifyBuild an image and tag it
docker buildx build --tag image:tag .Identify--tagImage identifier (format: [registry/]repository[:tag]) Docker Buildx referenceBuild an image using a specific Dockerfile
docker buildx build --file path/to/Dockerfile .Identify--fileName of the Dockerfile (default: PATH/Dockerfile) Docker Buildx referenceBuild an image passing build-time variables
docker buildx build --build-arg HTTP_PROXY=http://proxy.example.com --build-arg VERSION=1.0 .Identify--build-argSet build-time variables Docker Buildx referenceTrips 1 Sigma rule: lowConnection Proxy by Ömer Günal
Build an image without using the build cache
docker buildx build --no-cache .Identify--no-cacheDo not use cache when building the image Docker Buildx referenceBuild an image and load it into docker images
docker buildx build --load --tag image:tag .Identify--loadShorthand for --output=type=docker Docker Buildx reference--tagImage identifier (format: [registry/]repository[:tag]) Docker Buildx referenceBuild for multiple platforms and push to a registry
docker buildx build --platform linux/amd64,linux/arm64 --push --tag registry.example.com/image:tag .Identify--platformSet target platform for build Docker Buildx reference--pushShorthand for --output=type=registry,unpack=false Docker Buildx reference--tagImage identifier (format: [registry/]repository[:tag]) Docker Buildx referenceBuild a specific stage from a multi-stage Dockerfile
docker buildx build --target stage_name --tag image:tag .Identify--targetSet the target build stage to build Docker Buildx reference--tagImage identifier (format: [registry/]repository[:tag]) Docker Buildx reference