Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (18 sloc) 835 Bytes
# Use Debian stretch until https://bugs.alpinelinux.org/issues/8131 is resolved.
FROM debian@sha256:de3eac83cd481c04c5d6c7344cd7327625a1d8b2540e82a8231b5675cef0ae5f AS qemu
RUN apt-get update && apt-get install -y qemu-user-static && \
mv /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64 && \
mv /usr/bin/qemu-arm-static /usr/bin/qemu-arm && \
mv /usr/bin/qemu-ppc64le-static /usr/bin/qemu-ppc64le
FROM linuxkit/alpine:3683c9a66cd4da40bd7d6c7da599b2dcd738b559 AS mirror
RUN apk add --no-cache go musl-dev
ENV GOPATH=/go PATH=$PATH:/go/bin
COPY main.go /go/src/binfmt/
RUN go-compile.sh /go/src/binfmt
FROM scratch
ENTRYPOINT []
WORKDIR /
COPY --from=qemu usr/bin/qemu-* usr/bin/
COPY --from=mirror /go/bin/binfmt usr/bin/binfmt
COPY etc/binfmt.d/00_linuxkit.conf etc/binfmt.d/00_linuxkit.conf
CMD ["/usr/bin/binfmt"]