-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (39 loc) · 1.74 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
FROM lscr.io/linuxserver/calibre:latest AS build-stage
ENV DEBIAN_FRONTEND noninteractive
RUN ebook-convert --version
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
&& sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
&& apt-get update \
&& apt-get install --force-yes --no-install-recommends curl fonts-wqy-microhei \
libglx-mesa0 libegl1 libxkbcommon0 libopengl0 -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/
SHELL ["/bin/bash", "-c"]
ARG NPM_REGISTRY=https://registry.npmmirror.com
ARG NPM_MIRROR=https://npmmirror.com
ENV NODE_VERSION=20.17.0
ARG TARGETARCH
RUN if [ "$TARGETARCH" = "arm64" ] ; then \
export ARCH=arm64 ; \
elif [ "$TARGETARCH" = "arm" ] ; then \
export ARCH=armv7l ; \
else \
export ARCH=x64 ; \
fi ; \
if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" = "arm" ] ; then \
apt-get update \
&& apt-get install libatomic1 --no-install-recommends -y \
&& rm -rf /var/lib/apt/lists/* ; \
fi \
&& curl -fsSLO --compressed "${NPM_MIRROR}/mirrors/node/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.gz" \
&& curl -fsSLO --compressed "${NPM_MIRROR}/mirrors/node/v$NODE_VERSION/SHASUMS256.txt" \
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.gz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -zxvf "node-v$NODE_VERSION-linux-$ARCH.tar.gz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.gz" SHASUMS256.txt \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
&& npm config set registry ${NPM_REGISTRY}
RUN which node ; node -v; npm install @whyun/gitbook -g
RUN useradd -ms /bin/bash gitbook
RUN chown gitbook:gitbook -R /opt
USER gitbook
RUN gitbook help