Skip to content
This repository was archived by the owner on Jan 10, 2021. It is now read-only.

Commit 88ef297

Browse files
Merge branch 'dockerize'
2 parents 90b55ff + 628056c commit 88ef297

25 files changed

+670
-4
lines changed

Books/Example/Example-Amazon.mobi

-1.87 MB
Binary file not shown.
-862 KB
Binary file not shown.

Books/Example/Example-ebook.pdf

-862 KB
Binary file not shown.

Books/Example/Example-print.pdf

-202 KB
Binary file not shown.

Books/Example/Example.epub

-862 KB
Binary file not shown.

Dockerfile

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
FROM debian:jessie
2+
MAINTAINER chrisanthropic <ctarwater@gmail.com>
3+
4+
###########################################################################################
5+
### BEGIN CUSTOM Open-Publisher Stuff ###
6+
###########################################################################################
7+
8+
RUN echo "deb http://ftp.us.debian.org/debian jessie contrib" > /etc/apt/sources.list.d/contrib.list ;\
9+
echo "deb http://ftp.us.debian.org/debian jessie-updates contrib" >> /etc/apt/sources.list.d/contrib.list ;
10+
11+
# Install TeXlive & Haskell & Dependencies
12+
RUN export DEBIAN_FRONTEND=noninteractive && \
13+
apt-get clean && \
14+
apt-get update -y && \
15+
apt-get upgrade -y && \
16+
apt-get install -y --fix-missing abcm2ps curl fontconfig git graphviz imagemagick libmagickcore-dev libmagickwand-dev inotify-tools latex-xcolor make python3 python-pygraphviz texlive-latex-base texlive-xetex texlive-fonts-extra wget
17+
18+
RUN export DEBIAN_FRONTEND=noninteractive && \
19+
apt-get install -y autoconf build-essential
20+
21+
# Install Ruby (code stolen from official Ruby docker)
22+
# skip installing gem documentation
23+
RUN mkdir -p /usr/local/etc \
24+
&& { \
25+
echo 'install: --no-document'; \
26+
echo 'update: --no-document'; \
27+
} >> /usr/local/etc/gemrc
28+
29+
ENV RUBY_MAJOR 2.1
30+
ENV RUBY_VERSION 2.1.9
31+
ENV RUBY_DOWNLOAD_SHA256 034cb9c50676d2c09b3b6cf5c8003585acea05008d9a29fa737c54d52c1eb70c
32+
ENV RUBYGEMS_VERSION 2.6.3
33+
34+
# some of ruby's build scripts are written in ruby
35+
# we purge this later to make sure our final image uses what we just built
36+
RUN set -ex \
37+
&& buildDeps=' \
38+
bison \
39+
libgdbm-dev \
40+
ruby \
41+
' \
42+
&& apt-get install -y libssl-dev \
43+
&& apt-get install -y --no-install-recommends $buildDeps \
44+
&& rm -rf /var/lib/apt/lists/* \
45+
&& curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
46+
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
47+
&& mkdir -p /usr/src/ruby \
48+
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
49+
&& rm ruby.tar.gz \
50+
&& cd /usr/src/ruby \
51+
&& { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \
52+
&& autoconf \
53+
&& ./configure --disable-install-doc \
54+
&& make -j"$(nproc)" \
55+
&& make install \
56+
&& apt-get purge -y --auto-remove $buildDeps \
57+
&& gem update --system $RUBYGEMS_VERSION \
58+
&& rm -r /usr/src/ruby
59+
60+
ENV BUNDLER_VERSION 1.11.2
61+
62+
RUN gem install bundler --version "$BUNDLER_VERSION"
63+
64+
# install things globally, for great justice
65+
# and don't create ".bundle" in all our apps
66+
ENV GEM_HOME /usr/local/bundle
67+
ENV BUNDLE_PATH="$GEM_HOME" \
68+
BUNDLE_BIN="$GEM_HOME/bin" \
69+
BUNDLE_SILENCE_ROOT_WARNING=1 \
70+
BUNDLE_APP_CONFIG="$GEM_HOME"
71+
ENV PATH $BUNDLE_BIN:$PATH
72+
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
73+
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
74+
75+
# Install Pandoc
76+
ENV PKGREL 1
77+
ENV VERSION 1.17.0.2
78+
ADD https://github.com/jgm/pandoc/releases/download/${VERSION}/pandoc-${VERSION}-${PKGREL}-amd64.deb /pandoc.deb
79+
RUN export DEBIAN_FRONTEND=noninteractive && \
80+
dpkg -i /pandoc.deb && \
81+
rm /pandoc.deb
82+
83+
# download kindlegen and install it to /usr/bin
84+
RUN wget http://kindlegen.s3.amazonaws.com/kindlegen_linux_2.6_i386_v2_9.tar.gz -O /tmp/kindlegen_linux_2.6_i386_v2_9.tar.gz
85+
RUN tar -xzf /tmp/kindlegen_linux_2.6_i386_v2_9.tar.gz -C /tmp
86+
RUN mv /tmp/kindlegen /usr/bin
87+
RUN rm -r /tmp/*
88+
89+
# Basic cleanup
90+
RUN export DEBIAN_FRONTEND=noninteractive && \
91+
apt-get clean -y && \
92+
rm -rf /var/lib/apt/lists/*
93+
94+
# Git clone the Open-Publisher repo
95+
#RUN git clone https://github.com/chrisanthropic/Open-Publisher.git
96+
97+
ADD . Open-Publisher/
98+
99+
WORKDIR /Open-Publisher
100+
101+
# Install jekyll
102+
RUN bundle install --binstubs --path=vendor
103+
104+
#ENTRYPOINT ["bundle exec rake"]
105+
CMD [""]

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
## Open-Publisher
2-
Open publisher is really just a couple of bash scripts that wrap around Jekyll, Pandoc, KindleGen, and LaTeX, along with some custom Pandoc templates.
1+
## DOCKER INSTRUCTIONS
2+
### Create docker container
3+
Git clone open-publisher repo
34

4-
Write your manuscript in markdown, run a script, and receive some beautifully formatted ePub, Mobi, and print-ready PDF books.
5+
`docker build -t open-publisher .`
56

6-
Full documentation website at [http://chrisanthropic.github.io/Open-Publisher-Documentation/](http://chrisanthropic.github.io/Open-Publisher-Documentation/)
7+
### Test run with example book
8+
#### Create example book
9+
This will move the contents of 'skel' to 'Source'
10+
`docker run -v $PWD/input:/Open-Publisher/Source -it open-publisher rake skel`
11+
12+
### Bind example book
13+
This will create two new directories (input & output) which are mounted inside the Docker container. input maps to Source and output maps to Books. Running this command will create all versions of the example book which you can see in output.
14+
15+
`docker run -v $PWD/input:/Open-Publisher/Source -v $PWD/output:/Open-Publisher/Books -it open-publisher rake all[all]`
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)