-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathDockerfile
27 lines (24 loc) · 834 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM rust AS builder
COPY . .
RUN apt update && apt install -y build-essential
# Install mdbook
RUN cargo install --git https://github.com/HollowMan6/mdBook mdbook
RUN cargo install --path .
FROM python AS base
RUN apt-get update \
&& apt-get install -y \
chromium fonts-wqy-microhei fonts-wqy-zenhei \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& rm -rf /root/.cache \
&& mkdir /mdbook-pdf
COPY . /mdbook-pdf
RUN pip3 install --no-cache-dir /mdbook-pdf \
&& rm -rf /mdbook-pdf
COPY --from=builder /usr/local/cargo/bin/mdbook-pdf /usr/local/bin/mdbook-pdf
COPY --from=builder /usr/local/cargo/bin/mdbook /usr/local/bin/mdbook
WORKDIR /book
# Add other mdbook backend at /mdbook dir
ENV PATH="$PATH:/mdbook"
ENTRYPOINT [ "mdbook", "build" ]