2025-05-02 00:46:59 +00:00
|
|
|
# syntax = docker/dockerfile:1.11-labs
|
|
|
|
|
|
|
|
|
|
FROM input AS lychee
|
|
|
|
|
ARG rust_toolchain="nightly"
|
|
|
|
|
ARG RUSTUP_HOME
|
|
|
|
|
ARG CARGO_HOME
|
|
|
|
|
ARG lychee_cache_age="7d"
|
|
|
|
|
ARG lychee_mode="color"
|
2025-06-01 11:40:09 +00:00
|
|
|
# .lycheecache is hardcoded as path to reg file in the cwd so we execute lychee
|
|
|
|
|
# in cache directory itself. all paths here should be absolute paths
|
|
|
|
|
ARG lychee_args="/usr/src/tuwunel/docs /usr/src/tuwunel/*.md"
|
2025-05-02 00:46:59 +00:00
|
|
|
|
2025-06-01 11:40:09 +00:00
|
|
|
WORKDIR /
|
|
|
|
|
COPY --link --from=input . .
|
|
|
|
|
|
|
|
|
|
WORKDIR /usr/src/
|
2025-05-02 00:46:59 +00:00
|
|
|
RUN \
|
2025-06-24 23:43:59 +00:00
|
|
|
--mount=type=cache,dst=${RUSTUP_HOME}/downloads,sharing=shared \
|
|
|
|
|
--mount=type=cache,dst=${CARGO_HOME}/registry,sharing=shared \
|
|
|
|
|
--mount=type=cache,dst=${CARGO_HOME}/git,sharing=shared \
|
2025-06-01 11:40:09 +00:00
|
|
|
--mount=type=cache,dst=lychee,sharing=locked \
|
2025-05-02 00:46:59 +00:00
|
|
|
<<EOF
|
|
|
|
|
set -eux
|
2025-06-01 11:40:09 +00:00
|
|
|
cd lychee
|
2025-05-02 00:46:59 +00:00
|
|
|
rustup run ${rust_toolchain} \
|
|
|
|
|
lychee \
|
|
|
|
|
--verbose \
|
2025-06-01 11:40:09 +00:00
|
|
|
--no-progress \
|
2025-05-02 00:46:59 +00:00
|
|
|
--offline \
|
2025-06-01 11:40:09 +00:00
|
|
|
--cache \
|
|
|
|
|
--max-cache-age "${lychee_cache_age}" \
|
|
|
|
|
--mode "${lychee_mode}" \
|
|
|
|
|
--exclude /usr/src/tuwunel/contributing.md \
|
|
|
|
|
--exclude /usr/src/tuwunel/development/testing.md \
|
2025-05-02 00:46:59 +00:00
|
|
|
${lychee_args}
|
|
|
|
|
EOF
|