diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..02f2038 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu:latest + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y \ + build-essential \ + calibre \ + pandoc \ + ruby \ + ruby-dev \ + wget \ + zlib1g-dev + +RUN gem install bundler --no-ri --no-rdoc + +COPY . / + +RUN bundle install diff --git a/README.md b/README.md index 9347997..475914b 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ Generates a EPUB/MOBI for the Google SRE Book. Original sources are downloaded from https://landing.google.com/sre/ +# Build + +## macOS + Review and run the `bootstrap.sh` script to generate the EPUB and MOBI files Requirements: @@ -17,6 +21,16 @@ Requirements: - brew cask install calibre - brew install wget +## Docker + +Requirements: + +- Docker + +``` +$ ./build_docker.sh +``` + # Known Issues - Inline references are not handled in the best possible way diff --git a/bootstrap.sh b/bootstrap.sh index 3b8286e..70ef38c 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -13,6 +13,6 @@ bundle install ruby generate.rb pushd html/chapters -pandoc -f html+smart -t epub+smart -o ../../google-sre.epub --epub-metadata=../../metadata.xml --epub-cover-image=../../cover.jpg sre.html +pandoc -f html -t epub -o ../../google-sre.epub --epub-metadata=../../metadata.xml --epub-cover-image=../../cover.jpg sre.html popd ebook-convert google-sre.epub google-sre.mobi diff --git a/build_docker.sh b/build_docker.sh new file mode 100755 index 0000000..8c450e4 --- /dev/null +++ b/build_docker.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +docker build -t google-sre-ebook . +docker run -i --rm -v "$(pwd):/output" google-sre-ebook sh -s <