|
| 1 | +FROM alpine:3.15.4 AS alpine_base |
| 2 | +FROM node:17.9.0-alpine3.15 AS node_base |
| 3 | +FROM gradle:6.9.2-jdk8 AS gradle_base |
| 4 | +# FROM gradle:7.2.0-jdk8 AS gradle_base |
| 5 | +FROM rust:1.60.0-alpine3.15 AS rust_base |
| 6 | +# FROM rust:1.51.0-slim-buster AS rust_base |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | +FROM gradle_base AS build-ditaa |
| 11 | + |
| 12 | +WORKDIR / |
| 13 | +RUN curl -OL https://github.com/pepijnve/ditaa/archive/mini-0.12.tar.gz |
| 14 | +RUN tar zxvf mini-*.tar.gz |
| 15 | +RUN mv ditaa-mini* ditaa-mini |
| 16 | +WORKDIR ditaa-mini |
| 17 | +RUN gradle jar --offline |
| 18 | +RUN cp build/libs/ditaa*.jar /ditaa.jar |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +FROM node_base AS build-vega |
| 23 | + |
| 24 | +RUN apk add g++ make pkgconf pixman-dev cairo-dev pango-dev libjpeg-turbo-dev giflib-dev |
| 25 | +RUN npm -g config set user root |
| 26 | +RUN npm install -g vega vega-cli vega-lite \ |
| 27 | + && npm cache clean --force |
| 28 | +RUN tar zcvf /vega.tgz /usr/local/bin/vl2* /usr/local/bin/vg2* /usr/local/lib/node_modules/vega* |
| 29 | +RUN mkdir /vega |
| 30 | +WORKDIR /vega |
| 31 | +RUN tar zxvf /vega.tgz |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +FROM node_base AS build-mermaid |
| 36 | +ARG MERMAID_VERSION |
| 37 | +WORKDIR /tmp |
| 38 | +RUN yarn add mermaid@${MERMAID_VERSION} |
| 39 | +RUN cp /tmp/node_modules/mermaid/dist/mermaid.min* / |
| 40 | +RUN ls -al / |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | +FROM rust_base AS build-svgbob |
| 45 | +ARG SVGBOB_VERSION |
| 46 | +WORKDIR /tmp |
| 47 | + |
| 48 | +# RUN apk add curl musl-dev |
| 49 | +# RUN curl -L -o svgbob.tgz https://github.com/ivanceras/svgbob/archive/${SVGBOB_VERSION}.tar.gz |
| 50 | +# RUN tar zxf svgbob.tgz |
| 51 | +# RUN mv svgbob-* svgbob |
| 52 | + |
| 53 | +RUN apk add curl musl-dev git |
| 54 | +RUN git clone https://github.com/ivanceras/svgbob.git |
| 55 | + |
| 56 | +WORKDIR svgbob |
| 57 | +RUN cargo build --release |
| 58 | +RUN cargo test --release |
| 59 | +RUN cp target/release/svgbob /svgbob.orig |
| 60 | +RUN echo "svgbob.orig \$@ | sed -n '/^<svg/,\$p'" > /svgbob |
| 61 | +RUN chmod a+rx /svgbob |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | +FROM alpine_base AS build-githubstyle |
| 66 | + |
| 67 | +WORKDIR /tmp |
| 68 | +RUN apk add git |
| 69 | +RUN git clone https://github.com/tajmone/pandoc-goodies.git |
| 70 | +RUN cp pandoc-goodies/templates/html5/github/GitHub.html5 / |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | +FROM alpine_base AS build-pandoc |
| 75 | +ARG PANDOC_VERSION |
| 76 | +WORKDIR /tmp |
| 77 | +RUN apk add curl |
| 78 | +RUN curl -L "https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz" | tar --strip-components=1 -zxvf - "pandoc-${PANDOC_VERSION}/bin/pandoc" |
| 79 | +RUN mv bin/pandoc / |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | +FROM alpine_base AS build-jquery |
| 84 | +ARG JQUERY_VERSION |
| 85 | +WORKDIR /tmp |
| 86 | +RUN apk add curl |
| 87 | +RUN curl -L -o /jquery.js https://code.jquery.com/jquery-${JQUERY_VERSION}.js |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | +FROM alpine_base AS build-jqueryemojis |
| 92 | +WORKDIR /tmp |
| 93 | +RUN apk add curl |
| 94 | +RUN curl -L -o emojis.zip https://github.com/rodrigopolo/jqueryemoji/archive/master.zip |
| 95 | +RUN unzip emojis.zip |
| 96 | +RUN mkdir /emojis |
| 97 | +RUN mv jqueryemoji-master/img/apple72/* /emojis |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | +FROM alpine_base AS build-revealjs |
| 102 | +ARG REVEALJS_VERSION |
| 103 | +WORKDIR /tmp |
| 104 | +RUN apk add curl |
| 105 | +RUN mkdir /reveal.js |
| 106 | +RUN curl -L "https://github.com/hakimel/reveal.js/archive/${REVEALJS_VERSION}.tar.gz" | tar -C /reveal.js --strip-components=1 --exclude test --exclude font -zxvf - |
| 107 | +WORKDIR /reveal.js |
| 108 | +RUN rm -rf *.md demo.html examples/ gulpfile.js package*.json test/ |
| 109 | +RUN touch dist/reveal.esm.js.map |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | +FROM alpine_base AS build-impressjs |
| 114 | +ARG IMPRESSJS_VERSION |
| 115 | +WORKDIR /tmp |
| 116 | +RUN apk add curl |
| 117 | +RUN mkdir /impress.js |
| 118 | +RUN curl -L "https://github.com/impress/impress.js/archive/${IMPRESSJS_VERSION}.tar.gz" | tar -C /impress.js --strip-components=1 --exclude examples --exclude test -zxvf - |
| 119 | +WORKDIR /impress.js |
| 120 | +RUN rm -rf *.md *.png build.js examples/ karma.conf.js package*.json qunit* test/ |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | +FROM alpine_base AS build-plantuml |
| 125 | +WORKDIR /tmp |
| 126 | +RUN apk add curl |
| 127 | +# RUN curl -L -o /plantuml.jar "https://sourceforge.net/projects/plantuml/files/plantuml.jar/download?use_mirror=10gbps-io" |
| 128 | +RUN curl -L -o /plantuml.jar "https://sourceforge.net/projects/plantuml/files/plantuml.jar/download" |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | +FROM alpine_base AS build-asciinemaplayer |
| 133 | +ARG ASCIINEMAPLAYER_VERSION |
| 134 | +WORKDIR /tmp |
| 135 | +RUN apk add curl |
| 136 | +RUN curl -L -o /asciinema-player.js "https://github.com/asciinema/asciinema-player/releases/download/${ASCIINEMAPLAYER_VERSION}/asciinema-player.js" |
| 137 | +RUN touch /asciinema-player.js.map |
| 138 | +RUN curl -L -o /asciinema-player.css "https://github.com/asciinema/asciinema-player/releases/download/${ASCIINEMAPLAYER_VERSION}/asciinema-player.css" |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | +FROM alpine_base AS build-foundationicons |
| 143 | +WORKDIR /tmp |
| 144 | +RUN apk add curl |
| 145 | +RUN curl -L -O https://zurb.com/playground/uploads/upload/upload/288/foundation-icons.zip |
| 146 | +RUN unzip foundation-icons.zip |
| 147 | +RUN mv foundation-icons / |
| 148 | + |
| 149 | + |
| 150 | + |
| 151 | +FROM alpine_base AS build-cssgg |
| 152 | +RUN apk add curl |
| 153 | +RUN curl -L -o /all-gg.css https://css.gg/css |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | +FROM alpine_base as build-mathjaxjs |
| 158 | +RUN apk add git |
| 159 | +RUN git clone https://github.com/mathjax/MathJax.git mj-tmp |
| 160 | +RUN mv mj-tmp/es5 /mathjax |
| 161 | + |
| 162 | + |
| 163 | + |
| 164 | + |
| 165 | +FROM scratch as build-docroot-3rdparty |
| 166 | + |
| 167 | +COPY --from=build-revealjs /reveal.js /markdeck/assets/framework/reveal.js/ |
| 168 | +COPY --from=build-impressjs /impress.js /markdeck/assets/framework/impress.js/ |
| 169 | +COPY --from=build-jquery /jquery.js /markdeck/assets/3rdparty/ |
| 170 | +COPY --from=build-jqueryemojis /emojis /markdeck/lib/ |
| 171 | +COPY --from=build-ditaa /ditaa.jar /markdeck/.markdeck/lib/ |
| 172 | +COPY --from=build-asciinemaplayer /asciinema-player.js /asciinema-player.js.map /asciinema-player.css /markdeck/assets/3rdparty/ |
| 173 | +COPY --from=build-plantuml /plantuml.jar /markdeck/.markdeck/lib/ |
| 174 | +COPY --from=build-githubstyle /GitHub.html5 /markdeck/.markdeck/template-github.html |
| 175 | +COPY --from=build-foundationicons /foundation-icons /markdeck/assets/markdeck/css |
| 176 | +COPY --from=build-cssgg /all-gg.css /markdeck/assets/markdeck/css |
| 177 | +COPY --from=build-mathjaxjs /mathjax /markdeck/assets/3rdparty/mathjax/ |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | +FROM scratch as build-docroot-markdeck |
| 182 | + |
| 183 | +COPY src/markdeck/explain.html /markdeck/ |
| 184 | +COPY src/markdeck/metadata.template /markdeck/.markdeck/ |
| 185 | +COPY src/markdeck/defaults.yaml /markdeck/.markdeck/ |
| 186 | +COPY src/markdeck/lib/*.lua /markdeck/.markdeck/ |
| 187 | +COPY src/markdeck/lib/*.config /markdeck/.markdeck/ |
| 188 | +COPY src/markdeck/lib/*.jar /markdeck/.markdeck/ |
| 189 | +COPY src/markdeck/assets/markdeck /markdeck/assets/markdeck/ |
| 190 | +COPY src/markdeck/template* /markdeck/.markdeck/ |
| 191 | +COPY src/scaffold/ /markdeck/scaffold/ |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | +FROM scratch as build-docroot |
| 196 | + |
| 197 | +COPY --from=build-docroot-3rdparty /markdeck /markdeck |
| 198 | +COPY --from=build-docroot-markdeck /markdeck /markdeck |
| 199 | + |
0 commit comments