#!/usr/bin/env bash set -e echo 'ENV NODE_VERSION 16.16.0' >> Dockerfile echo 'ENV YARN_VERSION 1.22.19' >> Dockerfile echo 'ENV ARCH x64' >> Dockerfile echo 'ENV CHECKSUM 2b74f0baaaa931ffc46573874a7d7435b642d28f1f283104ac297499fba99f0a' >> Dockerfile echo 'RUN addgroup -g 1000 node && adduser -u 1000 -G node -s /bin/sh -D node && apk add --no-cache libstdc++ && apk add --no-cache --virtual .build-deps curl' >> Dockerfile echo 'RUN curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz"; echo "$CHECKSUM node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" | sha256sum -c - && tar -xJf "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" -C /usr/local --strip-components=1 --no-same-owner && ln -s /usr/local/bin/node /usr/local/bin/nodejs && rm -f "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" && apk del .build-deps && node --version && npm --version' >> Dockerfile echo 'RUN apk add --no-cache --virtual .build-deps-yarn curl gnupg tar && for key in 6A010C5166006599AA17F08146C2130DFD2497F5 ; do gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; done && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz && mkdir -p /opt && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz && apk del .build-deps-yarn && yarn --version' >> Dockerfile echo 'RUN apk update && apk upgrade' >> Dockerfile echo 'RUN apk add --no-cache grep chromium freetype libstdc++ harfbuzz ttf-liberation font-noto-cjk font-noto-devanagari font-noto-arabic font-noto-bengali nss wayland-dev su-exec' >> Dockerfile echo 'RUN addgroup -S marp && adduser -S -g marp marp && mkdir -p /home/marp/app /home/marp/.cli && chown -R marp:marp /home/marp' >> Dockerfile echo 'USER marp' >> Dockerfile echo 'ENV CHROME_PATH /usr/bin/chromium-browser' >> Dockerfile echo 'RUN git clone https://github.com/marp-team/marp-cli.git /home/marp/.cli' >> Dockerfile echo 'WORKDIR /home/marp/.cli' >> Dockerfile echo 'RUN git checkout v2.0.4' >> Dockerfile echo 'RUN ls .' >> Dockerfile echo 'RUN yarn add @babel/core' >> Dockerfile echo 'RUN yarn install --production --frozen-lockfile && yarn cache clean && node marp-cli.js --version' >> Dockerfile