Skip to content

Instantly share code, notes, and snippets.

@klutchell
Last active April 1, 2021 14:14
Show Gist options
  • Save klutchell/1eff23177ed112e02a0f825adc9f9555 to your computer and use it in GitHub Desktop.
Save klutchell/1eff23177ed112e02a0f825adc9f9555 to your computer and use it in GitHub Desktop.
python3-slim (buildroot)
# caching
BR2_DL_DIR="/cache/dl"
BR2_CCACHE=y
BR2_CCACHE_DIR="/cache/ccache"
BR2_CCACHE_USE_BASEDIR=y
# arch
BR2_arm=y
# toolchains
BR2_TOOLCHAIN_BUILDROOT_MUSL=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_KERNEL_HEADERS_4_19=y
BR2_GCC_ENABLE_LTO=y
# init
BR2_INIT_NONE=y
# system utils
BR2_PACKAGE_BUSYBOX=y
BR2_SYSTEM_BIN_SH_NONE=n
BR2_PACKAGE_IFUPDOWN_SCRIPTS=n
BR2_PACKAGE_PYTHON3=y
#syntax=docker/dockerfile:1.2
FROM klutchell/buildroot-base:2020.11 as build
# copy common config
COPY common.cfg ./.config
# hadolint ignore=SC2215
RUN --mount=type=cache,target=/cache,uid=1000,gid=1000,sharing=private \
make olddefconfig && make source && 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" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment