From d443741556f4898011bd24aba7bd3f9f83ee53ba Mon Sep 17 00:00:00 2001 From: Stille Date: Tue, 1 Feb 2022 00:32:51 +0800 Subject: [PATCH] Create gitbook --- gitbook/Dockerfile | 14 ++++++++++++++ gitbook/README.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 gitbook/Dockerfile create mode 100644 gitbook/README.md diff --git a/gitbook/Dockerfile b/gitbook/Dockerfile new file mode 100644 index 0000000..c111730 --- /dev/null +++ b/gitbook/Dockerfile @@ -0,0 +1,14 @@ +FROM node:10.22.0-alpine3.9 +LABEL org.opencontainers.image.authors="stille@ioiox.com" + +ENV VERSION 3.2.3 + +RUN npm install gitbook-cli -g +RUN gitbook fetch $VERSION + +EXPOSE 4000 +VOLUME /gitbook + +WORKDIR /gitbook + +CMD ["gitbook", "--help"] diff --git a/gitbook/README.md b/gitbook/README.md new file mode 100644 index 0000000..d2fcfc3 --- /dev/null +++ b/gitbook/README.md @@ -0,0 +1,31 @@ +# gitbook + +GitHub [stilleshan/dockerfiles](https://github.com/stilleshan/dockerfiles) +Docker [stilleshan/gitbook](https://hub.docker.com/r/stilleshan/gitbook) +> *docker image support for X86 and ARM* + +## 简介 +gitbook for docker, 方便本地使用 docker 来启动服务编写文档. + +## 使用 +### 初始化 init +```shell +docker run --rm -v "$PWD:/gitbook" -p 4000:4000 stilleshan/gitbook gitbook init +# 初始化当前目录 +``` + +### 服务 serve +```shell +docker run --rm -v "$PWD:/gitbook" -p 4000:4000 stilleshan/gitbook gitbook serve +# 启动 serve 服务 +``` +访问`http://localhost:4000` + +### 构建 build +```shell +docker run --rm -v "$PWD:/gitbook" -p 4000:4000 stilleshan/gitbook gitbook build +# 打包构建 +``` + +## 参考 +- [Gitbook](https://github.com/GitbookIO/gitbook)