-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
58 lines (42 loc) · 1.72 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM alpine:3.12 as build
RUN apk add --no-cache rust cargo openssl openssl-dev make g++
RUN apk add --no-cache fontconfig-dev harfbuzz-dev harfbuzz-icu icu-dev freetype-dev graphite2-dev libpng-dev zlib-dev
ARG UID=1000
ARG GID=1000
ARG TECTONIC_VERSION=0.3.3
RUN addgroup -g ${GID} tectonic && \
adduser -D -h /home/tectonic -u ${UID} -G tectonic tectonic
USER tectonic
RUN cargo install --vers ${TECTONIC_VERSION} tectonic
RUN mkdir /home/tectonic/bin
# Get makeindex
RUN cd /tmp && \
busybox wget http://mirrors.ctan.org/indexing/makeindex.zip && \
unzip makeindex.zip && \
rm makeindex.zip && \
cd /tmp/makeindex/src/ && \
make && \
cp makeindex /home/tectonic/bin/ && \
chmod 555 /home/tectonic/bin/makeindex && \
rm -rf /tmp/makeindex
# Get makeglossaries
RUN cd /home/tectonic/bin && \
busybox wget http://mirrors.ctan.org/macros/latex/contrib/glossaries/makeglossaries && \
chmod 555 makeglossaries
FROM alpine:3.12
ARG UID=1000
ARG GID=1000
ARG MOUNTDIR=/tectonic
RUN apk add --no-cache fontconfig harfbuzz harfbuzz-icu icu freetype graphite2 libpng zlib openssl perl
RUN mkdir -p /home/tectonic/.cache /home/tectonic/.cargo/bin /home/tectonic/.config/Tectonic /home/tectonic/bin /home/tectonic/man /tectonic && \
addgroup -g ${GID} tectonic && \
adduser -D -h /home/tectonic -u ${UID} -G tectonic tectonic && \
chown -R tectonic:tectonic /home/tectonic /tectonic
USER tectonic
COPY --from=build /home/tectonic/.cargo/bin /home/tectonic/.cargo/bin
COPY --from=build /home/tectonic/bin /home/tectonic/bin
ENV PATH="/home/tectonic/.cargo/bin:/home/tectonic/bin/:${PATH}"
VOLUME [ "${MOUNTDIR}" ]
VOLUME [ "/home/tectonic/.cache" ]
WORKDIR ${MOUNTDIR}
ENTRYPOINT [ "tectonic" ]