# MAIN: https://eaguru.guru/git/notwa/stargazing # REPO: https://eaguru.guru/git/notwa/stargazing FROM docker.io/library/alpine:3.18 as partial # need this for acquire (.tar.xz files): RUN apk add --no-cache xz COPY --chmod=0755 acquire cosmocc dedupe ofc quickconf shed \ /usr/local/bin/ RUN ln -s /usr/local/bin /nu WORKDIR /media/common FROM partial as downloader # this demonstrates how to use the `acquire` script. ARG BUSYBOX_VERSION=1.36.0 ARG BUSYBOX_SHA256=542750c8af7cb2630e201780b4f99f3dcceeb06f505b479ec68241c1e6af61a5 # https://git.alpinelinux.org/aports/tree/main/busybox/APKBUILD RUN --mount=type=cache,id=common,target=/media/common,sharing=locked \ --mount=type=tmpfs,target=/tmp : \ && name=busybox \ && remote_fn="$name-$BUSYBOX_VERSION.tar.bz2" \ && export local_fn="$remote_fn" \ && export remote_url="http://busybox.net/downloads/$remote_fn" \ && export dest=/root/$name \ && export sha256="$BUSYBOX_SHA256" \ && acquire \ ; FROM docker.io/library/alpine:3.18 as builder RUN apk add --no-cache gcc linux-headers make musl-dev # configure and build a rescue shell and some utilities, # i.e. one better suited for images built "FROM scratch". # this can greatly differ from Alpine's build of busybox. # for one thing, this build is half the size of Alpine's. # this binary is *not* an APE; it's only for Linux hosts. COPY --from=downloader /root /root WORKDIR /root/busybox COPY busybox.config .config RUN make -j2 && du -h busybox FROM partial as final COPY --chmod=0755 --from=builder /root/busybox/busybox /usr/local/bin/busybox