Skip to content

Commit 9d07ce7

Browse files
committed
Merge branch 'main' of github.com:whyun-docker/gitbook
2 parents 648c041 + d848695 commit 9d07ce7

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

Dockerfile

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,35 @@ RUN ebook-convert --version
55
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
66
&& sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
77
&& apt-get update \
8-
&& apt-get install --force-yes --no-install-recommends wget fonts-wqy-microhei \
8+
&& apt-get install --force-yes --no-install-recommends curl fonts-wqy-microhei \
99
libgl1-mesa-glx libegl1 libxkbcommon0 libopengl0 -y \
10-
&& apt-get clean
10+
&& apt-get clean \
11+
&& rm -rf /var/lib/apt/lists/
1112

1213
SHELL ["/bin/bash", "-c"]
13-
RUN wget https://mirrors.huaweicloud.com/nodejs/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz
14-
RUN mkdir -p /usr/local/node && tar -zxvf node-v${NODE_VERSION}-linux-x64.tar.gz -C /usr/local/node
15-
ENV PATH="/usr/local/node/node-v${NODE_VERSION}-linux-x64/bin/:${PATH}"
14+
ARG NPM_REGISTRY=https://registry.npmmirror.com
15+
ARG NPM_MIRROR=https://npmmirror.com
16+
ARG TARGETARCH
17+
RUN if [ "$TARGETARCH" = "arm64" ] ; then \
18+
export ARCH=arm64 ; \
19+
elif [ "$TARGETARCH" = "arm" ] ; then \
20+
export ARCH=armv7l ; \
21+
else \
22+
export ARCH=x64 ; \
23+
fi ; \
24+
if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" = "arm" ] ; then \
25+
apt-get update \
26+
&& apt-get install libatomic1 --no-install-recommends -y \
27+
&& rm -rf /var/lib/apt/lists/* ; \
28+
fi \
29+
&& curl -fsSLO --compressed "${NPM_MIRROR}/mirrors/node/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.gz" \
30+
&& curl -fsSLO --compressed "${NPM_MIRROR}/mirrors/node/v$NODE_VERSION/SHASUMS256.txt" \
31+
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.gz\$" SHASUMS256.txt | sha256sum -c - \
32+
&& tar -zxvf "node-v$NODE_VERSION-linux-$ARCH.tar.gz" -C /usr/local --strip-components=1 \
33+
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.gz" SHASUMS256.txt \
34+
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
35+
&& npm config set registry ${NPM_REGISTRY}
1636

17-
RUN npm config set registry https://registry.npmmirror.com
1837
RUN which node ; node -v; npm install gitbook-cli svgexport -g
1938
RUN gitbook fetch 3.2.3
2039

0 commit comments

Comments
 (0)