diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..78f0e05 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM osrg/ryu +# ARG user=osrg + +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get update -qq && apt-get upgrade -y && \ + apt-get install -y -qq \ + lsb-release git sudo make \ + inkscape texlive-latex-recommended \ + texlive-latex-extra texlive-fonts-recommended \ + python-minimal python-pip python-sphinx +# RUN useradd -ms /bin/bash devel +# RUN usermod -aG sudo devel +# RUN echo "devel ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/devel +# USER devel +# WORKDIR /home/devel + +CMD [ "/home/osrg/ryu-book/do-build.sh" ] diff --git a/README.md b/README.md index 87540d2..9875718 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,14 @@ $ source venv/bin/activate (venv) $ bash ./build.sh en ``` +Alternative build method +======================== +```bash +./mk-book.sh +``` +Will trigger a build using the original Ryu Docker image. The target is controlled in `do-build.sh`. +Currently the English PDF is produced. After running the command the PDF appears in the `en/` directory. + Building Ryu-Book on Travis-CI ============================== diff --git a/do-build.sh b/do-build.sh new file mode 100644 index 0000000..7e1dcea --- /dev/null +++ b/do-build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +cd $(dirname $0) +# sudo python -m pip install --upgrade pip +pip install -r requirements.txt +python setup.py install +make -C en clean +make -C en PAPER=a4 latexpdf +cp -vf en/build/latex/Ryubook.pdf en diff --git a/mkbook.sh b/mkbook.sh new file mode 100644 index 0000000..000e536 --- /dev/null +++ b/mkbook.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +BASEDIR=$(dirname $(realpath $0)) +docker build -t ryu-book:latest -f Dockerfile . +docker run -it \ + --mount "type=bind,source=$BASEDIR,target=/home/osrg/ryu-book" \ + --name ryubook ryu-book:latest + +ZOMBIES="$(docker ps -aq -f status=exited)" +[ -z "$ZOMBIES" ] || docker rm "$ZOMBIES" + +DANGLING="$(docker image ls -aq -f dangling=true)" +[ -z "$DANGLING" ] || docker rmi "$DANGLING"