changed fixed versions to mermaid 7.0.0 and phantomjs 2.1.4 because of bug in drawing arrows in mermaid >7.0.0

This commit is contained in:
Felix Lohmeier 2017-10-29 22:54:44 +01:00
parent 03ffb68a84
commit 6d9834b1ea
2 changed files with 15 additions and 13 deletions

View File

@ -1,12 +1,6 @@
FROM node:8.8.1 FROM node:8.8.1
RUN mkdir /tmp/phantomjs \ RUN yarn global add phantomjs-prebuilt@2.1.14 mermaid@7.0.0
&& 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 WORKDIR /data

View File

@ -1,15 +1,15 @@
# Docker container for mermaid # 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/). [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.0 and is build on top of the official node 8.8.1 image.
* [GitHub Repository with Dockerbuild files](https://github.com/felixlohmeier/mermaid-docker) * [GitHub Repository with Dockerbuild files](https://github.com/felixlohmeier/mermaid-docker)
* [Docker Hub with docker images](https://hub.docker.com/r/felixlohmeier/mermaid) * [Docker Hub with docker images](https://hub.docker.com/r/felixlohmeier/mermaid)
## fixed versions ## fixed versions
* [mermaid 7.0.11](https://www.npmjs.com/package/mermaid) * [mermaid 7.0.0](https://yarn.pm/mermaid)
* [node 8.8.1](https://hub.docker.com/_/node/) * [node 8.8.1](https://hub.docker.com/_/node/)
* [phantomjs 2.1.1](https://bitbucket.org/ariya/phantomjs/downloads/) * [phantomjs 2.1.4](https://yarn.pm/phantomjs-prebuilt)
## usage ## usage
@ -18,7 +18,15 @@
## typical workflow ## typical workflow
1. Create your graph in [mermaid's live editor](https://mermaidjs.github.io/mermaid-live-editor/) 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 2. Copy & paste your graph config in a text editor and save it to a local file
3. Run docker to create png and/or svg. Example (render svg and png; width of the generated png: 600 pixel): 3. Download a stylesheet from <https://unpkg.com/mermaid@7.0.13/dist/themes/> (and customize it if you want)
4. Run this docker container to create png and svg.
> docker run --rm -v "$PWD":/data:z mermaid -s -p -w 600 myflowchart.mmd ## Example
* render both formats (svg + png): `-s -p`
* width of the png: 600 pixel: `-w 600`
* apply custom stylesheet [mermaid.neutral.css](https://unpkg.com/mermaid@7.0.13/dist/themes/mermaid.neutral.css) from local file `-t mermaid.neutral.css`
* name of local file containing graph config: `myflowchart.mmd`
> docker run --rm -v "$PWD":/data:z felixlohmeier/mermaid -s -p -w 600 -t mermaid.neutral.css myflowchart.mmd