|
2 | 2 | # docker buildx create --use --driver=docker-container --name container --bootstrap |
3 | 3 | # docker buildx build . --cache-to type=local,dest=.cache,mode=max --cache-from type=local,src=.cache --platform=linux/arm64 --builder=container --progress plain -o docs/_build/html -f Dockerfile.build-doc |
4 | 4 |
|
5 | | -# map source image to base |
6 | | -FROM python:3.13 AS base |
7 | | -ENV DEBIAN_FRONTEND=noninteractive |
8 | | -WORKDIR /app |
9 | | -RUN \ |
10 | | - --mount=type=cache,target=/var/cache/apt,sharing=shared \ |
11 | | - --mount=type=cache,target=/var/lib/apt,sharing=shared \ |
12 | | - rm -f /etc/apt/apt.conf.d/docker-clean && \ |
13 | | - echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache && \ |
14 | | - apt-get update && \ |
15 | | - apt-get install -y patchelf musl-tools |
16 | | - |
17 | | -FROM base AS builder |
| 5 | +FROM python:3.13 AS builder |
18 | 6 | WORKDIR /app |
19 | 7 | COPY LICENSE.md . |
20 | 8 | COPY README.md . |
21 | 9 | COPY requirements-pip.txt . |
22 | | -COPY scripts scripts/ |
23 | 10 | COPY pyproject.toml . |
24 | 11 | COPY docs docs/ |
25 | 12 | RUN \ |
26 | 13 | --mount=type=cache,target=/root/.cache/pip,sharing=shared \ |
27 | 14 | python3 -m venv .venv && \ |
28 | 15 | . .venv/bin/activate && \ |
29 | | - echo "List pip cache..." && \ |
30 | | - pip3 cache list && \ |
31 | 16 | python3 -m pip install --disable-pip-version-check -r requirements-pip.txt && \ |
32 | 17 | pip3 install --disable-pip-version-check --group doc |
33 | 18 | RUN \ |
34 | 19 | . .venv/bin/activate && \ |
35 | | - echo "Building binaries..." && \ |
36 | | - sphinx-build docs docs/_build/html && \ |
37 | | - ls -la docs/_build/html |
| 20 | + echo "Building docs..." && \ |
| 21 | + sphinx-build docs docs/_build/html |
38 | 22 |
|
39 | 23 | FROM scratch |
40 | 24 | WORKDIR / |
41 | | -COPY --from=builder /app/docs/_build/html/* . |
42 | | -COPY --from=builder /app/docs/_build/html/_static/* ./_static/ |
43 | | -COPY --from=builder /app/docs/_build/html/_sources/* ./_sources/ |
44 | | -COPY --from=builder /app/docs/_build/html/.doctrees/* ./.doctrees/ |
| 25 | +COPY --from=builder /app/docs/_build/html . |
0 commit comments