Joseph Jude

Write your book using softcover and docker

2017.03.06 / tech / books / nodejs / hapijs /

Softcover provides a tool to build the book and publish. Use docker to install this publishing tool.

Just before starting this blog post, I submitted the final manuscript for my first book. Writing a book is a long and tiring work with uncertain future. Much like a startup.

Writing the book went like this: We, my sister and I, pitched the book to Apress in January, 2016; they vetted the book proposal and approved it; we wrote the book for six months and submitted for review; an editor and a technical reviewer gave their suggestions; we modified and resubmitted; the content of the book is now approved and sent for publishing.

It is still not read by any potential reader. We don't know if the market will accept it or reject it.

I am writing my next book in a different way. I am borrowing the idea of "agile model" from software development practice. Following the agile model, I am writing it in an incremental and iterative model with feedback from potential readers.

Some established publishers like Oreilly already have early release programs. This allows authors to obtain feedback as they progress. I could approach them. But, hyperlinks subverts hierarchy. So, why not try on my own?

I found a platform that supports this mental model. Softcover calls itself a frictionless self-publishing platform. They pay up to 90% royalty. That is not the only reason to love it. Michael Hartl, its founder has worked hard to provide an open business model. He has provided an open source build tool that any author can use to write and generate ebooks. Authors are not even tied to sell using Softcover site. There are no monthly charges. Just a flat 10% fee on a sale through softcover platform. I like this model. So I have chosen it for my next book.

Softcover provides a tool that converts markdown based content into neatly formatted ebooks (mobi, epub, and pdf). It depends on nodejs, ruby, and LaTex so on. Instead of installing all of these on my machine, I chose to use Docker. Docker is best suited for such tools. If you don't know about docker, read this overview post at hackernoon.

Nick Merwin from Softcover has already provided the necessary Dockerfile. It is based on Ubuntu. It works like a charm.

Working with softcover within docker goes like this:

For reference the Dockerfile is listed here:

FROM phusion/baseimage:0.9.11
MAINTAINER Nick Merwin <[email protected]>

ENV HOME /root
RUN /etc/my_init.d/
CMD ["/sbin/my_init"]

RUN apt-get update \
  && apt-get install -y ruby gems g++ ruby-dev libcurl3 libcurl3-gnutls \
  libcurl4-openssl-dev imagemagick default-jre inkscape phantomjs \
  calibre texlive-full nodejs

# nodejs => node
RUN cd /usr/local/bin && ln -s /usr/bin/nodejs node


RUN curl -LO \ \
  && unzip -d bin && rm

RUN curl -LO \ \
  && tar -zxvf kindlegen_linux_2.6_i386_v2_9.tar.gz \
  && rm kindlegen_linux_2.6_i386_v2_9.tar.gz \
  && cd /usr/local/bin \
  && ln -s ~/kindlegen kindlegen

RUN apt-get install -y libxslt-dev libxml2-dev build-essential
RUN gem install softcover --pre --no-ri --no-rdoc

RUN softcover check

RUN mkdir /book


I would like to convert this into an alpine based image. I tried, but I got so many errors. I will have to try it later.

If you are interested, you can follow as I update the book. Check it out at softcover.

Share this post on

Twitter | | |
Sign up for my weekly newsletter

I will send blog updates to this email. You can unsubscribe at any time using the link in those emails.