Nantes Université

Skip to content
Extraits de code Groupes Projets
Valider c8ebb1b1 rédigé par Erwan BOUSSE's avatar Erwan BOUSSE
Parcourir les fichiers

Add README

parent 777c6fcf
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
= Draw.io Docker image
Fedora-based very basic Docker image to run Draw.io in CLI mode, eg. to convert `.drawio` files into `.png` files.
Relies on _xvfb-run_ to create a fake graphical environment, otherwise Draw.io fails to work (even in CLI mode).
NOTE: This image is not built to be lightweight, and is quite heavy. I tried making smaller image using another base than Fedora, but I could not manage to fix problems appearing with fonts when exporting to PNG. That's why I sticked with Fedora.
== Using the image
The image is deployed in a link:https://gitlab.univ-nantes.fr/bousse-e/docker-drawio/container_registry[container registry of the University of Nantes Gitlab instance].
To test if the image works:
```
docker run --rm docker-registry.univ-nantes.fr/bousse-e/docker-drawio drawio --version
```
To export a `.drawio` file into a `.png`:
```
docker run --rm -w /data -v $PWD:/data docker-registry.univ-nantes.fr/bousse-e/docker-drawio drawio --export --crop --output out.png in.drawio
```
Or you can even use the image in a `.gitlab-ci.yml` file to convert your `drawio` files in a CI process − that's actually the reason for this image to exist in the first place :).
== Building the image
Simply run:
```
docker build . -t docker-drawio
```
Then you can use your locally built image called `docker-drawio` (ie. you can remplace `docker-registry.univ-nantes.fr/bousse-e/docker-drawio` by `docker-drawio` in the previous examples).
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter