@@ -5,16 +5,35 @@ 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
+ 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}
16
36
17
- RUN npm config set registry https://registry.npmmirror.com
18
37
RUN which node ; node -v; npm install gitbook-cli svgexport -g
19
38
RUN gitbook fetch 3.2.3
20
39
0 commit comments