Skip to content

Commit

Permalink
tools: labs: add docker-docs target that build docs via docker
Browse files Browse the repository at this point in the history
Signed-off-by: Octavian Purdila <tavi@cs.pub.ro>
  • Loading branch information
tavip committed Mar 2, 2020
1 parent 1738e2a commit 60a2292
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
12 changes: 10 additions & 2 deletions Documentation/teaching/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,22 @@ Computers, University POLITEHNICA of Bucharest.

You can get the latest version at http://github.com/linux-kernel-labs.

To get started build the documentation from the sources:
To get started build the documentation from the sources after
installing docker-compose on you host:

.. code-block:: c
cd tools/teaching && make docs
cd tools/teaching && make docker-docs
then point your browser at **Documentation/output/labs/index.html**.

Alternatively, you can build directly on the host (see
tools/labs/docs/Dockerfile for dependencies):

.. code-block:: c
cd tools/teaching && make docs
.. toctree::
:caption: Lectures

Expand Down
6 changes: 5 additions & 1 deletion tools/labs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ copy: $(YOCTO_IMAGE)
sudo umount $(TEMPDIR)
rmdir $(TEMPDIR)

docker-docs:
cd docs && docker-compose build
cd docs && docker-compose run docs-build bash -c "cd /linux/tools/labs && make docs"

docs:
$(MAKE) -C $(KDIR) DOCBOOKS= SPHINXDIRS="teaching" htmldocs
$(MAKE) -C $(KDIR) BUILDDIR=$(KDIR)/Documentation/output/slides DOCBOOKS= SPHINXDIRS="teaching" slides
Expand All @@ -40,4 +44,4 @@ docs:
clean::
-rm -rf skels

.PHONY: skels build copy docs clean
.PHONY: skels build copy docs clean docker-docs
26 changes: 26 additions & 0 deletions tools/labs/docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ubuntu:18.04

RUN apt-get update
RUN apt-get install -y software-properties-common
RUN apt-get install -y sudo
RUN apt-get install -y make
RUN apt-get install -y git
RUN apt-get install -y python
RUN apt-get install -y python-pip
RUN apt-get install -y ditaa
RUN apt-get install -y graphviz
RUN pip install Sphinx==1.6.7 sphinx_rtd_theme hieroglyph==1.0
# append new packages here, to minimize docker rebuild time
RUN rm -rf /var/lib/apt/lists/*

RUN useradd -ms /bin/bash ubuntu && adduser ubuntu sudo && echo -n 'ubuntu:ubuntu' | chpasswd

# Enable passwordless sudo for users under the "sudo" group
RUN sed -i.bkp -e \
's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' \
/etc/sudoers

USER ubuntu
WORKDIR /home/ubuntu/

ENV PATH ${PATH}:/home/ubuntu/.local
12 changes: 12 additions & 0 deletions tools/labs/docs/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3'
services:
docs-build:
build:
context: .
dockerfile: Dockerfile
volumes:
- ../../../:/linux
environment:
# workaround for binfmt_misc support in containers
- SPHINX_DITAA_CMD=jexec
- SPHINX_DITAA_ARG=/usr/bin/ditaa

0 comments on commit 60a2292

Please sign in to comment.