## install docker-buildx ```bash sudo apt-get install jq curl -y mkdir -p ~/.docker/cli-plugins BUILDX_URL=$(curl -fsSL https://api.github.com/repos/docker/buildx/releases/latest | jq -r .assets[].browser_download_url | grep linux-amd64) echo $BUILDX_URL curl -fsSL -o ~/.docker/cli-plugins/docker-buildx $BUILDX_URL chmod +x ~/.docker/cli-plugins/docker-buildx ``` ```bash docker buildx --help Usage: docker buildx [OPTIONS] COMMAND Build with BuildKit Options: --builder string Override the configured builder instance Management Commands: imagetools Commands to work on images in registry Commands: bake Build from a file build Start a build create Create a new builder instance du Disk usage inspect Inspect current builder instance ls List builder instances prune Remove build cache rm Remove a builder instance stop Stop builder instance use Set the current builder instance version Show buildx version information Run 'docker buildx COMMAND --help' for more information on a command. ``` ```bash docker buildx build --platform linux/amd64,linux/arm64 -t testb:1 . [+] Building 0.0s (0/0) error: multiple platforms feature is currently not supported for docker driver. Please switch to a different driver (eg. "docker buildx create --use") docker buildx create --name mbuilder --use docker buildx build --platform linux/amd64,linux/arm64 -t testb:1 . docker buildx imagetools inspect testb:1 docker run --privileged --rm tonistiigi/binfmt --install all ``` ## ref -