Skip to content

Commit

Permalink
修正pdf生成问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yunnysunny committed Dec 17, 2022
1 parent a0f8b10 commit e31fb7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
24 changes: 9 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
FROM ubuntu:20.04 AS build-stage
FROM lscr.io/linuxserver/calibre:latest AS build-stage
ENV NODE_VERSION=10.24.1
COPY docker/etc /etc

RUN apt-get update
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 wget fonts-wqy-microhei \
libgl1-mesa-glx libegl1 libxkbcommon0 libopengl0 -y \
&& apt-get clean

RUN apt-get install -y wget
SHELL ["/bin/bash", "-c"]
RUN wget https://mirrors.huaweicloud.com/nodejs/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz
RUN mkdir -p /usr/local/node && tar -zxvf node-v${NODE_VERSION}-linux-x64.tar.gz -C /usr/local/node
Expand All @@ -14,18 +18,8 @@ RUN npm config set registry https://mirrors.huaweicloud.com/repository/npm/
RUN npm install gitbook-cli -g
RUN gitbook fetch 3.2.3

ENV DEBIAN_FRONTEND noninteractive
# 官网给的安装依赖说明 https://calibre-ebook.com/download_linux
RUN apt-get install python xdg-utils xz-utils libegl1 libopengl0 -yq
RUN wget --no-check-certificate -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin
RUN ebook-convert --version
# 官网未提及的依赖
RUN apt-get install libnss3 libxdamage1 -y
# 中文字体
RUN apt-get install -y --force-yes --no-install-recommends fonts-wqy-microhei
RUN useradd -ms /bin/bash gitbook
RUN chown gitbook:gitbook -R /opt
# RUN npm install gitbook -g

USER gitbook
RUN gitbook current
Expand Down
1 change: 0 additions & 1 deletion gen_pdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ BUILD_TAG=yunnysunny/nodebook:latest
mkdir -p output

# load_cache ${SAVE_NAME}
docker pull ubuntu:20.04
docker build --target build-stage \
--tag ${BUILD_TAG} \
--cache-from type=local,src=${CACHE_FILE} \
Expand Down

0 comments on commit e31fb7d

Please sign in to comment.