制作GitBook的Docker镜像

####### 环境信息
CentOS7.x
docker18.6

mkdir gitbook
cd gitbook
vi Dockerfile
FROM node:8.11.1
RUN npm config set registry https://registry.npm.taobao.org && \
npm install gitbook-cli -g && \
gitbook -V && \
mkdir /gitbook
EXPOSE 4000
CMD ["sh", "-c", "gitbook install /gitbook; gitbook serve /gitbook"]

构建镜像

sudo docker build -t gitbook .

启动服务

# 启动可能会较慢
docker run -d -p 4000:4000 -v /opt/docker_practice:/gitbook gitbook:latest
推送镜像
docker tag gitbook:latest 192.168.61.100/library/gitbook:latest
docker push 192.168.61.100/library/gitbook:latest
posted @   一毛丶丶  阅读(211)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示