-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
75 lines (55 loc) · 1.65 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# syntax=docker/dockerfile:1.9
ARG BUILD_DIR=/build
ARG FONT_NAME=afio
# Check https://github.com/be5invis/Iosevka/releases for font version
ARG FONT_VERSION=32.1.0
################################################################
FROM node:22-slim AS base_builder
ARG TARGETARCH
ENV DEBIAN_FRONTEND=noninteractive
RUN rm -f /etc/apt/apt.conf.d/docker-clean; \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN \
--mount=type=cache,id=apt-${TARGETARCH},target=/var/cache/apt \
--mount=type=cache,id=apt-${TARGETARCH},target=/var/lib/apt \
<<EOF
set -e
apt-get update -yqq
apt-get install --no-install-recommends -yqq \
build-essential \
ca-certificates \
curl \
fontforge \
python3-fontforge \
ttfautohint
EOF
FROM base_builder AS iosevka_src
ARG FONT_VERSION
WORKDIR /
RUN <<-EOF
set -ex
curl -sSL https://github.com/be5invis/Iosevka/archive/v${FONT_VERSION}.tar.gz | tar xvz
mv /Iosevka-${FONT_VERSION} /iosevka
EOF
FROM base_builder AS builder_iosevka
ARG TARGETARCH
ARG FONT_NAME
ARG BUILD_DIR
WORKDIR ${BUILD_DIR}/iosevka
COPY --link private-build-plans.toml .
COPY --from=iosevka_src /iosevka .
RUN --mount=type=cache,id=node-${TARGETARCH},target=${BUILD_DIR}/iosevka/node_modules \
<<-EOF
set -ex
npm i
npm run build -- ttf::${FONT_NAME}
EOF
WORKDIR ${BUILD_DIR}/src/glyphs
COPY --link nerd/glyphs .
WORKDIR ${BUILD_DIR}
COPY --link nerd/font-patcher .
WORKDIR ${BUILD_DIR}
COPY --link ./src/docker_run.py .
RUN chmod +x docker_run.py
ENV FONT_NAME=${FONT_NAME}
CMD [ "/bin/bash", "-c", "time ./docker_run.py" ]