Skip to content

Gitbook Docker 集成开发环境。支持CJK,附带常用工具。使用它,下面一些列环境配置都可以省略了。开箱即用。

License

Notifications You must be signed in to change notification settings

appotry/docker-gitbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-gitbook-builder

A Docker Image for building ebook with Gitbook and Noto CJK Fonts.

debian 加速

echo "===add debian 国内源==="
sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list

Basic

Read the official documentation GitbookIO/gitbook first.

Docker Pull

docker pull bloodstar/gitbook-builder
# run
docker run -ti --name="gitbook-builder" -v "$PWD:/gitbook" bloodstar/gitbook-builder /bin/bash

Usage

Read the official GitBook Toolchain Documentation documentation GitbookIO/gitbook first.

# init
docker run --rm -v "$PWD:/gitbook" -p 4000:4000 bloodstar/gitbook-builder gitbook init
# serve
docker run --rm -v "$PWD:/gitbook" -p 4000:4000 bloodstar/gitbook-builder gitbook serve
# build
docker run --rm -v "$PWD:/gitbook" -p 4000:4000 bloodstar/gitbook-builder gitbook build

For short, you can use alias for the long command line text. Place the alias statement in your .bashrc or .zshrc.

alias gitbook='docker run --rm -v "$PWD":/gitbook -p 4000:4000 bloodstar/gitbook-builder gitbook'
# init
gitbook init
# serve
gitbook serve
# build
gitbook build
# pdf output
gitbook pdf .
# epub output
gitbook epub .

Integrate with Gitlab CI

This docker image is originally designed for generating ebook with Gitlab CI. You could configure your Gitlab CI as following:

before_script:
  - env
  - export LC_ALL=zh_CN.UTF-8

stages:
  - build

ebook:
  stage: build
  script:
    - gitbook pdf
  artifacts:
    paths:
      - book.pdf
  only:
    - master
  tags:
    - gitbook
  image: bloodstar/gitbook-builder:latest
  allow_failure: true

Additional Features

This docker image also has OpenJDK 11 installed. The Java runtime allows you to run Gitbook PlantUML plugin.

Customization

To install your own favorite fonts, add the following RUN command in Dockerfile

## Install Fonts
RUN apt-get update && \
    apt-get install -y --no-install-recommends your-favorite-fonts && \
    rm -rf /var/lib/apt/lists/*

Acknowledge

The project is sponsored under Productivity Side Project plan of ECOWORK Inc.

ECOWORK is a Taiwan-based software and service company and is also hiring now:

  • Cloud Architect, Cloud Arch Team
  • Cloud Platform Engineer, Cloud Arch Team
  • iOS/Android Engineer, Mobile Team
  • Ruby/Go/Node Engineer, Application Team
  • Operation Engineer, Service Team

The working location of the above opportunities is Taipei, Taiwan. Resume and inquiry are welcome to [email protected].

About

Gitbook Docker 集成开发环境。支持CJK,附带常用工具。使用它,下面一些列环境配置都可以省略了。开箱即用。

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published