Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
==============================
Expand Down
9 changes: 9 additions & 0 deletions do-build.sh
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions mkbook.sh
Original file line number Diff line number Diff line change
@@ -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"