Comments (8)
To make the display
format work, you have to ensure the xdg-command
is available on your machine.
This command is used by the underlying library to display the graph : https://github.com/graphp/graphviz/blob/master/src/GraphViz.php#L126
from docker-compose-viz.
Ther'e must be something wrong in graphwiz then because the xdg-command is available in $PATH.
$ which xdg-open
/usr/bin/xdg-open
I see no way to trace the error though :-( both stderr
and stdout
are redirected to null
.
from docker-compose-viz.
Close to catching the error
docker run --rm \
-it \
-v $(pwd):/input/ \
-u 0 \
pmsipilot/docker-compose-viz \
php -r 'exec("xdg-open docker-compose.png >/dev/null>/dev/null");'
sh: xdg-open: not found
adding apk add xdg-utils
in Dockerfile is not enough, there must be a way to pass the command to the host.
from docker-compose-viz.
@lrkwz As you mention there are some missing packages inside the Docker image.
After adding them and running some tests it appears there are some other issues:
- using the
display
format through Docker will require you to bind the display: this is done by sharing the X11 socket. It's quite easy on Linux but a bit more tricky on Linux...and don't ask me to support Windows :D - The
graphp/graphviz
library runsxdg-open
as a background job (using&
on the command line). When running inside Docker (with--rm
) xdg-open is immediately killed and has no chance to run the image viewer. I'll have to find a workaround here.
from docker-compose-viz.
@jubianchi Thank you for your analysis. I don't have the capacity to actively participate here right now, but if you feel anything is missing/unclear in graphp/graphviz, make sure to let me know and I'll try to look into this 👍
from docker-compose-viz.
@clue I don't really think graphp/graphviz
is missing anything. We are in some kind of edge-case here (using xdg-open
in an asynchronous way when the parent process has a short lifetime).
I think I'll extend the class and override the display
method to get the expected behavior when running in Docker.
If you ever want to integrate this change in the library I'll be happy to open a PR on your side. But for now, I don't want to bother you with such "specific" changes. If you ever get a feature request for this kind of use-case, I'll be happy to contribute to your (really useful) library ;)
from docker-compose-viz.
I'm always happy to hear if any of my libraries is useful! 👍 That being said, I don't consider this to be perfect, so if you feel this is useful, go ahead, I'm happy about PRs
from docker-compose-viz.
@wixyvir would you mind taking a look at this issue and see if #32 is something we should build upon?
Thanks 🙏
from docker-compose-viz.
Related Issues (20)
- Using "Long Syntax" for volumes generates `PHP Warning: explode() expects parameter 2 to be string, array given` HOT 4
- failed to open stream: Permission denied HOT 8
- file_put_contents Permission denied HOT 4
- Include multiple docker-compose.yml in chart HOT 6
- docker run command wouldnt work for powershell (worth mentioning the variation?)
- Volume arrow destination label is not consistent
- Render SVGs? HOT 2
- Doesn't source related .env file? HOT 1
- network_mode: service:[container] not properly recognized
- Does this work for Kubernetes also? HOT 1
- Exclude or suppress services? HOT 1
- Docker - failed to open stream permission denied HOT 4
- Viz depends on deprecated "version" top-element being present HOT 1
- YAML anchor throws error HOT 1
- Render profiles
- Nice ! Thanks !
- Malformed inline YAML string error when using command arguments list HOT 1
- Minor fixes to readme
- 😎 Dark Mode Please 😎 HOT 1
- File /path/to/docker-compose.yml does not exist HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-compose-viz.