Skip to content

Commit fab7636

Browse files
committed
Add Dockerfile for sequence diagram generation
1 parent b6e345c commit fab7636

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

docs/design/clustering/Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM debian:jessie
2+
3+
RUN apt-get update
4+
RUN apt-get -qy install python-seqdiag make curl
5+
6+
WORKDIR /diagrams
7+
8+
RUN curl -sLo DroidSansMono.ttf https://googlefontdirectory.googlecode.com/hg/apache/droidsansmono/DroidSansMono.ttf
9+
10+
ADD . /diagrams
11+
12+
CMD bash -c 'make >/dev/stderr && tar cf - *.png'

docs/design/clustering/Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,16 @@ $(FONT):
1414

1515
%.png: %.seqdiag $(FONT)
1616
seqdiag --no-transparency -a -f '$(FONT)' $<
17+
18+
# Build the stuff via a docker image
19+
.PHONY: docker
20+
docker:
21+
docker build -t clustering-seqdiag .
22+
docker run --rm clustering-seqdiag | tar xvf -
23+
24+
docker-clean:
25+
docker rmi clustering-seqdiag || true
26+
docker images -q --filter "dangling=true" | xargs docker rmi
27+
28+
fix-clock-skew:
29+
boot2docker ssh sudo date -u -D "%Y%m%d%H%M.%S" --set "$(shell date -u +%Y%m%d%H%M.%S)"

docs/design/clustering/README.md

+17
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,20 @@ pip install seqdiag
77
```
88

99
Just call `make` to regenerate the diagrams.
10+
11+
## Building with Docker
12+
If you are on a Mac or your pip install is messed up, you can easily build with docker.
13+
14+
```
15+
make docker
16+
```
17+
18+
The first run will be slow but things should be fast after that.
19+
20+
To clean up the docker containers that are created (and other cruft that is left around) you can run `make docker-clean`.
21+
22+
If you are using boot2docker and get warnings about clock skew (or if things aren't building for some reason) then you can fix that up with `make fix-clock-skew`.
23+
24+
## Automatically rebuild on file changes
25+
26+
If you have the fswatch utility installed, you can have it monitor the file system and automatically rebuild when files have changed. Just do a `make watch`.

0 commit comments

Comments
 (0)