initial commit

This commit is contained in:
Felix Lohmeier 2017-10-29 17:55:33 +01:00
commit d0432bd562
2 changed files with 38 additions and 0 deletions

14
Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM node:8.8.1
RUN mkdir /tmp/phantomjs \
&& curl -L https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 \
| tar -xj --strip-components=1 -C /tmp/phantomjs \
&& mv /tmp/phantomjs/bin/phantomjs /usr/bin \
&& rm -rf /tmp/phantomjs
RUN yarn global add mermaid@7.0.11
WORKDIR /data
ENTRYPOINT ["mermaid"]
CMD ["--help"]

24
README.md Normal file
View File

@ -0,0 +1,24 @@
# Docker container for mermaid
[mermaid](http://knsv.github.io/mermaid/) is an open source tool for generating diagram and flowchart from text in a similar manner as markdown. This docker image contains mermaid 7.0.11 and is build on top of the official node 8.8.1 image. Installing the dependency phantomjs is tricky. I chose the solution from [jribar](https://hub.docker.com/r/jribar/node-phantomjs/~/dockerfile/).
* [GitHub Repository with Dockerbuild files](https://github.com/felixlohmeier/mermaid.cli-docker)
* [Docker Hub with docker images](https://hub.docker.com/r/felixlohmeier/mermaid.cli/)
## fixed versions
* [mermaid 7.0.11](https://www.npmjs.com/package/mermaid)
* [node 8.8.1](https://hub.docker.com/_/node/)
* [phantomjs 2.1.1](https://bitbucket.org/ariya/phantomjs/downloads/)
## usage
> docker run --rm -v "$PWD":/data:z felixlohmeier/mermaid
## typical workflow
1. Create your graph in [mermaid's live editor](https://mermaidjs.github.io/mermaid-live-editor/)
2. Copy & paste your graph config in a text editor and save as myflowchart.mmd
3. Run docker to create png and/or svg. Example (render svg and png; width of the generated png: 600 pixel):
> docker run --rm -v "$PWD":/data:z mermaid -s -p -w 600 myflowchart.mmd