Skip to content

Commit 3c8a0d5

Browse files
Add docker image (#153)
* Added docker image to easier build documentation * Minor fixes * Improve docker image, use docker hub
1 parent 606d5cd commit 3c8a0d5

File tree

2 files changed

+68
-4
lines changed

2 files changed

+68
-4
lines changed

Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM alpine:3.4
2+
3+
RUN set -xe \
4+
&& apk --no-cache add \
5+
bash \
6+
enchant \
7+
aspell-en \
8+
git \
9+
make \
10+
python \
11+
py-pip
12+
13+
ADD requirements.txt .
14+
15+
RUN pip install -r requirements.txt --no-cache-dir
16+
17+
WORKDIR /doc
18+
19+
VOLUME ["/doc"]
20+
21+
CMD ["/bin/bash"]

development/documentation.rst

+47-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,51 @@
11
Building the Documentation
2-
--------------------------
2+
==========================
33

4-
First `install Sphinx`_ and `install enchant`_ (e.g. ``sudo apt-get install enchant``),
5-
then download the requirements:
4+
We build the documentation with Sphinx. You could install it on your system or use Docker.
5+
6+
7+
Install Sphinx
8+
--------------
9+
10+
11+
Install on local machine
12+
~~~~~~~~~~~~~~~~~~~~~~~~
13+
14+
The installation for Sphinx differs between system. See `Sphinx installation page`_ for details. When Sphinx is
15+
installed you need to `install enchant`_ (e.g. ``sudo apt-get install enchant``).
16+
17+
18+
Using Docker
19+
~~~~~~~~~~~~
20+
21+
If you are using docker. Run the following commands from the repository root.
22+
23+
.. code-block:: bash
24+
25+
$ docker run --rm -it -v "$PWD":/doc phphttp/documentation
26+
$ # You are now in the docker image
27+
$ make html
28+
$ make spelling
29+
30+
Alternatively you can run the commands directly from the host
31+
without entering the container shell:
32+
33+
.. code-block:: bash
34+
35+
$ docker run --rm -t -v "$PWD":/doc phphttp/documentation make html
36+
$ docker run --rm -t -v "$PWD":/doc phphttp/documentation make spelling
37+
38+
.. warning::
39+
40+
The Docker container runs with `root` user by default
41+
which means the owner of the generated files will be `root`
42+
on the host too.
43+
44+
45+
Build documentation
46+
-------------------
47+
48+
Before we can build the documentation we have to make sure to install all requirements.
649

750
.. code-block:: bash
851
@@ -15,6 +58,6 @@ To build the docs:
1558
$ make html
1659
$ make spelling
1760
18-
.. _install Sphinx: http://sphinx-doc.org/latest/install.html
61+
.. _Sphinx installation page: http://sphinx-doc.org/latest/install.html
1962
.. _install enchant: http://www.abisource.com/projects/enchant/
2063

0 commit comments

Comments
 (0)