2024-02-01 02:02:43 +00:00
|
|
|
FROM golang:1.21.6-alpine as build
|
2018-03-17 19:00:34 +00:00
|
|
|
|
|
|
|
WORKDIR /tmp/build
|
|
|
|
|
|
|
|
COPY resin-xbuild.go /tmp/build
|
|
|
|
|
|
|
|
RUN go build -ldflags "-w -s" resin-xbuild.go
|
|
|
|
|
|
|
|
RUN apk add --no-cache curl
|
|
|
|
|
2021-10-11 07:20:21 +00:00
|
|
|
ENV QEMU_RELEASE_TAG v6.0.0+balena1
|
2021-10-11 07:24:16 +00:00
|
|
|
ENV QEMU_RELEASE_FILE qemu-6.0.0.balena1-arm.tar.gz
|
2021-10-11 07:20:21 +00:00
|
|
|
ENV QEMU_RELEASE_SHA256 359c30fb422a18766642cdc634d575ca2d0b6d6d58bda0ec2e33b425c508194c
|
2018-03-17 19:00:34 +00:00
|
|
|
|
2020-08-11 10:08:47 +00:00
|
|
|
RUN QEMU_URL="https://github.com/balena-io/qemu/releases/download/${QEMU_RELEASE_TAG}/${QEMU_RELEASE_FILE}" ; \
|
2018-03-17 19:00:34 +00:00
|
|
|
curl -fsSL ${QEMU_URL} -o ${QEMU_RELEASE_FILE}
|
|
|
|
|
|
|
|
RUN echo "${QEMU_RELEASE_SHA256} ${QEMU_RELEASE_FILE}" > ${QEMU_RELEASE_FILE}.sha256sum \
|
|
|
|
sha256sum -c ${QEMU_RELEASE_FILE}.sha256sum
|
|
|
|
|
|
|
|
RUN tar --strip 1 -xzf ${QEMU_RELEASE_FILE}
|
|
|
|
|
2024-02-05 20:02:53 +00:00
|
|
|
FROM --platform=linux/arm/v7 alpine:3.19.1
|
2015-12-24 22:54:20 +00:00
|
|
|
|
|
|
|
ENV QEMU_EXECVE 1
|
2016-09-05 12:01:54 +00:00
|
|
|
|
2018-03-17 19:00:34 +00:00
|
|
|
COPY --from=build /tmp/build/qemu-arm-static /usr/bin
|
|
|
|
COPY --from=build /tmp/build/resin-xbuild /usr/bin
|
2016-09-05 12:01:54 +00:00
|
|
|
|
2017-03-21 11:05:53 +00:00
|
|
|
RUN [ "/usr/bin/qemu-arm-static", "/bin/sh", "-exc", "ln -s resin-xbuild /usr/bin/cross-build-start; ln -s resin-xbuild /usr/bin/cross-build-end; ln /bin/sh /bin/sh.real" ]
|