Linux build command
## AMD64
docker buildx build --platform linux/amd64 -t "ookangzheng/curl-http3:latest" -f Dockerfile .
## ARM64
docker buildx build --platform linux/arm64 -t "ookangzheng/curl-http3:latest" -f Dockerfile .
Enable build arm64 on Linux amd64 architecture
## Command to run
docker buildx build --platform linux/arm64 -t "ookangzheng/curl-http3:latest" -f Dockerfile .
## Error
=> [builder 2/7] WORKDIR /opt 0.1s
=> ERROR [stage-1 2/6] RUN apk add --no-cache curl libgcc libstdc++ 0.6s
=> ERROR [builder 3/7] RUN apk add --no-cache build-base git autoconf libtool cmake go curl rust cargo perl autoconf automake libtool file nasm pkgconfig; 0.5s
------
> [stage-1 2/6] RUN apk add --no-cache curl libgcc libstdc++:
0.547 exec /bin/sh: exec format error
------
------
> [builder 3/7] RUN apk add --no-cache build-base git autoconf libtool cmake go curl rust cargo perl autoconf automake libtool file nasm pkgconfig;:
0.442 exec /bin/sh: exec format error
------
Dockerfile:12
--------------------
10 |
11 | # Install necessary build dependencies
12 | >>> RUN apk add --no-cache build-base git autoconf libtool cmake go curl rust cargo perl autoconf automake libtool file nasm pkgconfig;
13 |
14 | # https://github.com/curl/curl/blob/master/docs/HTTP3.md#quiche-version
--------------------
ERROR: failed to solve: process "/bin/sh -c apk add --no-cache build-base git autoconf libtool cmake go curl rust cargo perl autoconf automake libtool file nasm pkgconfig;" did not complete successfully: exit code: 1
docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64
Solution
docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64
Photo by Ian Taylor on Unsplash