Zenika-Training / zenika-formation-framework

Tools to build and present our training material
8 stars 25 forks source link

PDF generation not working inside the Docker image #162

Closed olivierhuber closed 7 years ago

olivierhuber commented 7 years ago
snowy:formation-java olivier$ ./run.sh pdf
Génération du pdf
Unable to find image 'zenika/formation-framework:latest' locally
latest: Pulling from zenika/formation-framework
3690ec4760f9: Pull complete
e2376eb84da2: Pull complete
01e9cd5496f8: Pull complete
af705d377c01: Pull complete
98e40bf84afa: Pull complete
66e083efe0ac: Pull complete
ec1710a4e143: Pull complete
bbc03f30c945: Pull complete
Digest: sha256:23bb070ffd427efe68df62c13ad4c493617c93408f16290eb41d755308eda05e
Status: Downloaded newer image for zenika/formation-framework:latest
Running "connect:print" (connect) task
Started connect web server on http://0.0.0.0:8000

Running "doGenerateSlidesPDF" task

Warning: spawn /data/node_modules/zenika-formation-framework/node_modules/phantomjs/lib/phantom/bin/phantomjs ENOENT Use --force to continue.

Aborted due to warnings.
hgwood commented 7 years ago

At least I can reproduce this one. ^^

hgwood commented 7 years ago

The docker image seems to behave strangely...

$ docker run -it --rm zenika/formation-framework ls /data/node_modules/zenika-formation-framework/node _modules/phantomjs/lib/phantom/bin/phantomjs
/data/node_modules/zenika-formation-framework/node_modules/phantomjs/lib/phantom/bin/phantomjs

$ docker run -it --rm zenika/formation-framework /data/node_modules/zenika-formation-framework/node_mo dules/phantomjs/lib/phantom/bin/phantomjs
standard_init_linux.go:178: exec user process caused "no such file or directory"
bpetetot commented 7 years ago

When I tried to build the image with FROM node:latest instead of FROM node:7.2-alpine, it works... It must miss something in the alpine node image for phantomjs to work properly, but I did not find what

hgwood commented 7 years ago

Good idea. I'll try it out.

gmembre-zenika commented 7 years ago

si tu es aventureux, tu peux utiliser strace pour savoir où il plante. C'est un outil qui trace tout les appels systèmes et notamment les ouvertures de fichier j'ai pas le conteneur sous la main mais qqch du genre :

docker run -it --rm zenika/formation-framework bash
# installer le paquet strace
# apt-get update && apt-get install -y strace ou yum install -y strace
# puis lancement du cmd pour verifier que ca plante tjs : 
/data/node_modules/zenika-formation-framework/node_mo dules/phantomjs/lib/phantom/bin/phantomjs
#ca doit planter
# lancement avec strace
strace -e trace=file /data/node_modules/zenika-formation-framework/node_mo dules/phantomjs/lib/phantom/bin/phantomjs
# ça va degeuler de log, il faut partir de la fin pour voir quel fichier il ne trouve pas

Je veux bien t'aider à eplucher la log stv

hgwood commented 7 years ago

Looks good. PR: #166.

hgwood commented 7 years ago

@gmembre-zenika y'a pas apt-get sur les images Alpine.

gmembre-zenika commented 7 years ago

apt, yum, apk, fait ce que tu veux pour installer le paquet :)