forked from gbif/gbif-asciidoctor-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
97 lines (78 loc) · 4.14 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
FROM asciidoctor/docker-asciidoctor:1.0.0
LABEL MAINTAINERS="Matthew Blissett <mblissett@gbif.org>"
# FixUID: https://github.com/boxboat/fixuid
RUN addgroup --gid 1000 asciidoctor && adduser --uid 1000 --ingroup asciidoctor --home /documents --shell /bin/bash --disabled-password --gecos "" asciidoctor
RUN USER=asciidoctor && \
GROUP=asciidoctor && \
curl -SsL https://github.com/boxboat/fixuid/releases/download/v0.4/fixuid-0.4-linux-amd64.tar.gz | tar -C /usr/local/bin -xzf - && \
chown root:root /usr/local/bin/fixuid && \
chmod 4755 /usr/local/bin/fixuid && \
mkdir -p /etc/fixuid && \
printf "user: $USER\ngroup: $GROUP\n" > /etc/fixuid/config.yml
ENTRYPOINT ["fixuid", "-q"]
# PO4A translation tool
RUN apk add --no-cache diffutils perl-unicode-linebreak po4a
# Git commit plugin
RUN apk add --no-cache openssl openssl-dev cmake ruby-dev ruby-rdoc gcc musl-dev
RUN gem install rugged
# BibTeX plugin
RUN gem install asciidoctor-bibtex
COPY gbif.csl /usr/lib/ruby/gems/2.5.0/gems/csl-styles-1.0.1.10/vendor/styles/
# A2S diagrams (needs Go)
#RUN apk add --no-cache git make musl-dev go
#ENV GOROOT /usr/lib/go
#ENV GOPATH /go
#ENV PATH /go/bin:$PATH
#RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin
#RUN apk add --no-cache go git gcc musl-dev
#go get github.com/asciitosvg/asciitosvg/cmd/a2s
# Stylesheet compiler:
RUN apk add --no-cache ruby-rdoc ruby-bundler
RUN gem install compass --version 0.12.7 && \
gem install zurb-foundation --version 4.3.2
# Fonts for GBIF style (in particular, Chinese-Japanese-Korean support)
RUN mkdir -p /adoc/fonts && \
curl -SsL https://download.gbif.org/2020/03/KaiGenGothic.txz | tar -JxvC /adoc/fonts && \
curl -SsLO https://noto-website-2.storage.googleapis.com/pkgs/NotoSans-hinted.zip && unzip -jod /adoc/fonts NotoSans-hinted.zip && rm -f NotoSans-hinted.zip && \
curl -SsLO https://noto-website-2.storage.googleapis.com/pkgs/NotoEmoji-unhinted.zip && unzip -jod /adoc/fonts NotoEmoji-unhinted.zip && rm -f NotoEmoji-unhinted.zip && \
chmod a+r -R /adoc/fonts
# GNU Aspell for Oxford English (UN English) spellcheck
RUN apk add --no-cache aspell aspell-utils && \
mkdir /adoc/aspell && \
curl -Ss https://ftp.gnu.org/gnu/aspell/dict/en/aspell6-en-2019.10.06-0.tar.bz2 | tar -jxC /adoc/aspell && \
cd /adoc/aspell/aspell6-en-2019.10.06-0 && \
./configure && make && make install && \
rm -Rf /adoc/aspell
# Needed by build script.
RUN apk add --no-cache git python3 py3-setuptools
RUN pip3 install Unidecode
# Continuous build script and Brotli compression
RUN apk add --no-cache inotify-tools brotli libwebp-tools
# TODO: Move further up when the next AsciiDoctor is released.
ARG adoc_path=/usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10
COPY inline-syntax-highlighting.patch /adoc/patches/
RUN cd $adoc_path/ && patch -p1 < /adoc/patches/inline-syntax-highlighting.patch
# Use dashes for attribute translations language, and set zh to zh-CN.
RUN ln -s $adoc_path/data/locale/attributes-es.adoc $adoc_path/data/locale/attributes-es-419.adoc && \
ln -s $adoc_path/data/locale/attributes-es.adoc $adoc_path/data/locale/attributes-es-CO.adoc && \
ln -s $adoc_path/data/locale/attributes-es.adoc $adoc_path/data/locale/attributes-es-ES.adoc && \
ln -s $adoc_path/data/locale/attributes-fr.adoc $adoc_path/data/locale/attributes-fr-FR.adoc && \
ln -s $adoc_path/data/locale/attributes-pt.adoc $adoc_path/data/locale/attributes-pt-PT.adoc && \
ln -s $adoc_path/data/locale/attributes-zh_CN.adoc $adoc_path/data/locale/attributes-zh.adoc
# RUN gem install asciidoctor-question
COPY asciidoctor-question /adoc/asciidoctor-question/
RUN cd /adoc/asciidoctor-question && rake build && rake install
COPY gbif-stylesheet/ /adoc/gbif-stylesheet/
RUN cd /adoc/gbif-stylesheet && compass compile
COPY asciidoctor-extensions-lab/ /adoc/asciidoctor-extensions-lab/
COPY gbif-extensions/ /adoc/gbif-extensions/
COPY gbif-templates/ /adoc/gbif-templates/
COPY gbif-theme/ /adoc/gbif-theme/
COPY GbifHtmlConverter.rb asciidoc.dict /adoc/
# GBIF build scripts
ENV PRIMARY_LANGUAGE=en
COPY build continuous /usr/local/bin/
WORKDIR /documents
VOLUME /documents
USER asciidoctor:asciidoctor
CMD ["/usr/local/bin/build"]