Skip to content

Instantly share code, notes, and snippets.

@xiaoping378
Created November 25, 2021 07:20
Show Gist options
  • Save xiaoping378/f36a37bdd0766f67797bb8d5e05fecff to your computer and use it in GitHub Desktop.
Save xiaoping378/f36a37bdd0766f67797bb8d5e05fecff to your computer and use it in GitHub Desktop.
gitbook-dockerfile
FROM ruby:2.6.2-alpine3.9
MAINTAINER xiaoping378 <[email protected]>
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk add --no-cache bash git curl jq tar libc6-compat g++ openssh
RUN apk add --no-cache nodejs npm && \
npm config set registry https://registry.npm.taobao.org &&\
npm install --unsafe-perm -g markdown-spellcheck webpack webpack-cli
RUN apk add --no-cache ruby-dev ruby-rdoc && \
gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/ && \
gem install mdl
# Install html-proofer
RUN echo 'gem: --no-document' >> /etc/gemrc
RUN apk add --no-cache --virtual build-dependencies \
build-base \
libcurl \
libxml2-dev \
libxslt-dev && \
apk add --no-cache --update build-base libffi-dev && \
gem install nokogiri -- --use-system-libraries && \
gem install ffi && \
gem install etc && \
gem install bigdecimal && \
gem install html-proofer --no-document && \
apk del build-dependencies && \
apk add --no-cache bash git libcurl libxml2 libxslt && \
rm -rf /var/cache/apk/* && \
rm -rf /root/.gem/* && \
rm -rf /usr/local/bundle/cache/*.gem && \
rm -rf /usr/lib/ruby/gems/*/cache/*.gem
# Install gitbook
RUN npm install gitbook-cli -g && \
gitbook -V
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment