mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2024-09-19 09:51:48 +02:00
Docker image
This commit is contained in:
parent
36d0708dc2
commit
07505ef276
3 changed files with 42 additions and 0 deletions
4
.dockerignore
Normal file
4
.dockerignore
Normal file
|
@ -0,0 +1,4 @@
|
|||
**
|
||||
!src/glyphs/*.*
|
||||
!font-patcher
|
||||
!bin/scripts/docker-entrypoint.sh
|
19
Dockerfile
Normal file
19
Dockerfile
Normal file
|
@ -0,0 +1,19 @@
|
|||
FROM alpine:3.11
|
||||
|
||||
LABEL org.opencontainers.image.title="Nerd Fonts Patcher" \
|
||||
org.opencontainers.image.description="Patches developer targeted fonts with a high number of glyphs (icons)." \
|
||||
org.opencontainers.image.url="https://www.nerdfonts.com/" \
|
||||
org.opencontainers.image.source="https://github.com/ryanoasis/nerd-fonts" \
|
||||
org.opencontainers.image.licenses="MIT"
|
||||
|
||||
RUN apk add fontforge --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing && \
|
||||
apk add --no-cache py2-pip && \
|
||||
pip install configparser
|
||||
|
||||
# sys.stdout.write encoding (py)
|
||||
ENV PYTHONIOENCODING=utf-8
|
||||
|
||||
VOLUME /in /out
|
||||
COPY . /nerd
|
||||
|
||||
ENTRYPOINT [ "/bin/sh", "/nerd/bin/scripts/docker-entrypoint.sh" ]
|
19
bin/scripts/docker-entrypoint.sh
Normal file
19
bin/scripts/docker-entrypoint.sh
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
skip=false
|
||||
args=""
|
||||
|
||||
# Discard --out option
|
||||
for i; do
|
||||
[ "${i}" != "${i% *}" ] && i="\"$i\""
|
||||
if [ "$i" = "--out" ] || [ "$i" = "-o" ]; then
|
||||
skip=true
|
||||
else
|
||||
if [ "$skip" = false ] || [ "$i" == "-*" ]; then
|
||||
args="$args $i"
|
||||
fi
|
||||
skip=false
|
||||
fi
|
||||
done
|
||||
|
||||
for f in /in/*.otf /in/*.ttf /in/*.woff /in/*.eot; do [ -f $f ] && fontforge -script /nerd/font-patcher -out /out $args $f; done
|
Loading…
Reference in a new issue