Last active
April 6, 2021 12:29
-
-
Save klutchell/26b37fd07070ab468e473232f870df35 to your computer and use it in GitHub Desktop.
buildroot dashboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export DOCKER_BUILDKIT=1 | |
export DOCKER_CLI_EXPERIMENTAL=enabled | |
docker run --rm --privileged multiarch/qemu-user-static:5.2.0-2 --reset -p yes | |
# use buildx to build and load an amd64 image | |
docker buildx build . --pull --platform linux/amd64 \ | |
--tag balenablocks/dashboard:latest --load | |
# use buildx to build and load an arm64 image | |
docker buildx build . --pull --platform linux/arm64 \ | |
--tag balenablocks/dashboard:latest --load | |
# use buildx to build and load an arm32v7 image | |
docker buildx build . --pull --platform linux/arm/v7 \ | |
--tag balenablocks/dashboard:latest --load | |
# use buildx to build and load an arm32v6 image | |
docker buildx build . --pull --platform linux/arm/v6 \ | |
--tag balenablocks/dashboard:latest --load |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export DOCKER_BUILDKIT=1 | |
export DOCKER_CLI_EXPERIMENTAL=enabled | |
docker run --rm --privileged multiarch/qemu-user-static:5.2.0-2 --reset -p yes | |
# use buildx to build and push a multiarch manifest | |
docker buildx build . --pull \ | |
--platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 \ | |
--tag balenablocks/dashboard:latest --push |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG BR_VERSION=2020.11 | |
# hadolint ignore=DL3029 | |
FROM --platform=$BUILDPLATFORM klutchell/buildroot-rootfs-amd64:$BR_VERSION as rootfs-amd64 | |
# hadolint ignore=DL3029 | |
FROM --platform=$BUILDPLATFORM klutchell/buildroot-rootfs-arm64:$BR_VERSION as rootfs-arm64 | |
# hadolint ignore=DL3029 | |
FROM --platform=$BUILDPLATFORM klutchell/buildroot-rootfs-arm32v7:$BR_VERSION as rootfs-armv7 | |
# hadolint ignore=DL3029 | |
FROM --platform=$BUILDPLATFORM klutchell/buildroot-rootfs-arm32v6:$BR_VERSION as rootfs-armv6 | |
# hadolint ignore=DL3006 | |
FROM rootfs-$TARGETARCH$TARGETVARIANT as build | |
# copy common config | |
COPY package.cfg ./package.cfg | |
RUN support/kconfig/merge_config.sh -m .config package.cfg | |
RUN make olddefconfig && make source | |
RUN make | |
# hadolint ignore=DL3002 | |
USER root | |
WORKDIR /rootfs | |
# extract the rootfs so we can just COPY in future layers | |
RUN tar xpf /home/br-user/output/images/rootfs.tar -C /rootfs | |
FROM scratch | |
COPY --from=build rootfs/ / | |
CMD [ "/bin/busybox", "sh" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BR2_PACKAGE_PYTHON3=y | |
BR2_PACKAGE_BUSYBOX=y |
RUN support/kconfig/merge_config.sh -m .config package.cfg
does this mean i don't need to specify arch?
Correct, you don't need to specify anything that was already set in https://github.com/balena-io-playground/buildroot-base/tree/main/config
👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
RUN support/kconfig/merge_config.sh -m .config package.cfg
does this mean i don't need to specify arch?