A builder configured as docker buildx create --platform arm64,amd64 --name multi-platform-builder
A dockerfile like this:
FROM alpine
RUN echo hi \
&& echo bye
If you run a multi-arch build with `docker buildx build --platform linux/arm64,linux/amd64 --builder multi-platform-builder .` it should pass
Instead the buildkit docker container crashes with a segfault:
If you build for only one architecture, it builds fine. If you delete the unnecessary blank line and make the dockerfile look like this it also builds fine:
Given:
docker buildx create --platform arm64,amd64 --name multi-platform-builder
RUN echo hi \
&& echo bye
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xd03890] 2023-01-12 21:54:36 2023-01-12 21:54:36 goroutine 1584 [running]: 2023-01-12 21:54:36 github.com/moby/buildkit/frontend/dockerfile/dockerfile2llb.toDispatchState({, }, {, , }, {{0x0, 0x0}, {0xffff5c549d98, 0x40014304b0}, 0x4000f5c720, ...}) 2023-01-12 21:54:36 /src/frontend/dockerfile/dockerfile2llb/convert.go:199 +0x3830 2023-01-12 21:54:36 github.com/moby/buildkit/frontend/dockerfile/dockerfile2llb.Dockerfile2LLB({, }, {, , }, {{0x0, 0x0}, {0xffff5c549d98, 0x40014304b0}, 0x4000f5c720, ...}) 2023-01-12 21:54:36 /src/frontend/dockerfile/dockerfile2llb/convert.go:96 +0x4c 2023-01-12 21:54:36 github.com/moby/buildkit/frontend/dockerfile/builder.Build.func5.1() 2023-01-12 21:54:36 /src/frontend/dockerfile/builder/build.go:527 +0x164 2023-01-12 21:54:36 golang.org/x/sync/errgroup.(Group).Go.func1() 2023-01-12 21:54:36 /src/vendor/golang.org/x/sync/errgroup/errgroup.go:75 +0x5c 2023-01-12 21:54:36 created by golang.org/x/sync/errgroup.(Group).Go 2023-01-12 21:54:36 /src/vendor/golang.org/x/sync/errgroup/errgroup.go:72 +0xa4
FROM alpine
RUN echo hi \ && echo bye