Files
tuwunel/docker/Dockerfile.cargo.lychee
Jason Volk 9507ce9d03 docker: Fix target mount cache paths; relax locks on cargo home.
docker: Persist lychee cache.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-02 02:49:14 +00:00

38 lines
1.1 KiB
Docker

# syntax = docker/dockerfile:1.11-labs
FROM input AS lychee
ARG sys_target
ARG rust_toolchain="nightly"
ARG RUSTUP_HOME
ARG CARGO_HOME
ARG lychee_cache_age="7d"
ARG lychee_mode="color"
# .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"
WORKDIR /
COPY --link --from=input . .
WORKDIR /usr/src/
RUN \
--mount=type=cache,dst=${RUSTUP_HOME}/downloads,sharing=shared,ro \
--mount=type=cache,dst=${CARGO_HOME}/registry,sharing=shared,ro \
--mount=type=cache,dst=${CARGO_HOME}/git,sharing=shared,ro \
--mount=type=cache,dst=lychee,sharing=locked \
<<EOF
set -eux
cd lychee
rustup run ${rust_toolchain} \
lychee \
--verbose \
--no-progress \
--offline \
--cache \
--max-cache-age "${lychee_cache_age}" \
--mode "${lychee_mode}" \
--exclude /usr/src/tuwunel/contributing.md \
--exclude /usr/src/tuwunel/development/testing.md \
${lychee_args}
EOF