-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (23 loc) · 1.77 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
FROM node:16-alpine
LABEL org.opencontainers.image.source="https://gitlab.com/antora/docker-antora"
ENV NODE_PATH /usr/local/share/.config/yarn/global/node_modules
RUN apk --no-cache add curl findutils jq \
&& yarn global add --ignore-optional --silent @antora/cli@latest @antora/site-generator-default@latest \
&& yarn global add --ignore-optional --silent $(grep -o '^isomorphic-git@[^:]*' `yarn global dir`/yarn.lock) \
&& rm -rf $(yarn cache dir)/* \
&& find $(yarn global dir)/node_modules/`[ -d $(yarn global dir)/node_modules/asciidoctor.js ] && echo asciidoctor.js || echo @asciidoctor/core`/dist -mindepth 1 -maxdepth 1 -not -name node -exec rm -rf {} \; \
&& find $(yarn global dir)/node_modules/handlebars/dist -mindepth 1 -maxdepth 1 -not -name cjs -exec rm -rf {} \; \
&& find $(yarn global dir)/node_modules/handlebars/lib -mindepth 1 -maxdepth 1 -not -name index.js -exec rm -rf {} \; \
&& find $(yarn global dir)/node_modules/isomorphic-git -mindepth 2 -maxdepth 2 -regex '.+/dist/[^/]+' -not -name for-node -exec rm -rf {} \; \
&& find $(yarn global dir)/node_modules/isomorphic-git -mindepth 2 -maxdepth 2 -regex '.+/http/[^/]+' -not -name node -exec rm -rf {} \; \
&& find $(yarn global dir)/node_modules/isomorphic-git -maxdepth 1 -type f -not -name cli.js -not -regex '.+\.\(cjs\|json\|md\)' -exec rm -f {} \; \
&& rm -rf $(yarn global dir)/node_modules/js-yaml/dist \
&& rm -rf $(yarn global dir)/node_modules/json5/dist \
&& rm -rf $(yarn global dir)/node_modules/moment/min \
&& rm -rf $(yarn global dir)/node_modules/moment/src \
&& rm -rf $(yarn global dir)/node_modules/source-map/dist \
&& rm -rf /tmp/*
WORKDIR /antora
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["antora"]