@@ -5,16 +5,34 @@ RUN ebook-convert --version
5
5
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
6
6
&& sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
7
7
&& 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 \
9
9
libgl1-mesa-glx libegl1 libxkbcommon0 libopengl0 -y \
10
- && apt-get clean
10
+ && apt-get clean \
11
+ && rm -rf /var/lib/apt/lists/
11
12
12
13
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
+ RUN if [ "$TARGETARCH" = "arm64" ] ; then \
17
+ export ARCH=arm64 ; \
18
+ elif [ "$TARGETARCH" = "arm" ] ; then \
19
+ export ARCH=armv7l ; \
20
+ else \
21
+ export ARCH=x64 ; \
22
+ fi ; \
23
+ if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" = "arm" ] ; then \
24
+ apt-get update \
25
+ && apt-get install libatomic1 --no-install-recommends -y \
26
+ && rm -rf /var/lib/apt/lists/* ; \
27
+ fi \
28
+ && curl -fsSLO --compressed "${NPM_MIRROR}/mirrors/node/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.gz" \
29
+ && curl -fsSLO --compressed "${NPM_MIRROR}/mirrors/node/v$NODE_VERSION/SHASUMS256.txt" \
30
+ && grep " node-v$NODE_VERSION-linux-$ARCH.tar.gz\$ " SHASUMS256.txt | sha256sum -c - \
31
+ && tar -zxvf "node-v$NODE_VERSION-linux-$ARCH.tar.gz" -C /usr/local --strip-components=1 \
32
+ && rm "node-v$NODE_VERSION-linux-$ARCH.tar.gz" SHASUMS256.txt \
33
+ && ln -s /usr/local/bin/node /usr/local/bin/nodejs \
34
+ && npm config set registry ${NPM_REGISTRY}
16
35
17
- RUN npm config set registry https://registry.npmmirror.com
18
36
RUN which node ; node -v; npm install gitbook-cli -g
19
37
RUN gitbook fetch 3.2.3
20
38
0 commit comments