Merge remote-tracking branch 'origin/ryansquared/package-mdbook' into staging

This commit is contained in:
Anton Livaja 2024-08-14 23:55:29 -04:00
commit a3a0495b0c
No known key found for this signature in database
GPG key ID: 44A86CFF1FDF0E85
2 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,41 @@
FROM scratch AS base
ENV VERSION=0.4.40
ENV SRC_HASH=550da7ff02ef62c60db6e813b6dbae65b9ed3d491186ea74929536feaceea94b
ENV SRC_FILE=mdBook-${VERSION}.tar.gz
ENV SRC_SITE=https://codeload.github.com/rust-lang/mdBook/tar.gz/refs/tags/v${VERSION}
FROM base AS fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
COPY --from=stagex/rust . /
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/llvm . /
COPY --from=stagex/libunwind . /
COPY --from=stagex/openssl . /
COPY --from=stagex/zlib . /
COPY --from=stagex/ca-certificates . /
RUN tar xf ${SRC_FILE}
WORKDIR mdBook-${VERSION}
RUN cargo fetch
FROM fetch AS build
COPY --from=stagex/binutils . /
ENV RUST_BACKTRACE=1
ENV RUSTFLAGS='-C codegen-units=1 -C target-feature=+crt-static'
RUN --network=none \
cargo build \
--frozen \
--release \
--target x86_64-unknown-linux-musl \
--bin mdbook
FROM build AS install
RUN <<-EOF
set -eux
mkdir -p /rootfs/usr/bin
cp target/x86_64-unknown-linux-musl/release/mdbook /rootfs/usr/bin/mdbook
EOF
FROM stagex/filesystem AS package
COPY --from=install /rootfs/. /

View file

@ -1272,6 +1272,23 @@ out/make/index.json: \
out/stage3/index.json
$(call build,make)
.PHONY: mdbook
mdbook: out/mdbook/index.json
out/mdbook/index.json: \
packages/mdbook/Containerfile \
out/binutils/index.json \
out/busybox/index.json \
out/ca-certificates/index.json \
out/filesystem/index.json \
out/gcc/index.json \
out/libunwind/index.json \
out/llvm/index.json \
out/musl/index.json \
out/openssl/index.json \
out/rust/index.json \
out/zlib/index.json
$(call build,mdbook)
.PHONY: meson
meson: out/meson/index.json
out/meson/index.json: \