question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Docker] Use an absolute path for the entrypoint

See original GitHub issue

Describe the bug

When using the docker image, specifying /data twice is a bit confusing:

docker run -it -v /path/to/diagrams:/data minlag/mermaid-cli -i /data/diagram.mmd

Expected behavior

The following syntax would be easier:

docker run -it -v `pwd`:/data minlag/mermaid-cli -i ./path/to/diagram.mmd

Solution

Define an absolute path for the entrypoint and set the workdir to /data

ADD puppeteer-config.json  /puppeteer-config.json
WORKDIR /data
ENTRYPOINT ["/home/mermaidcli/node_modules/.bin/mmdc", "-p", "/puppeteer-config.json"]

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
daamiencommented, Dec 1, 2022

As a follow up, if the change breaks something, it will be fairly easy to restore the current behaviour with the --workdir option

docker run [...] --workdir=/home/mermaidcli minlag/mermaid-cli  -i /data/diagram.mmd -o /data/diagram.svg
1reaction
aloisklinkcommented, Nov 30, 2022

The pandoc docker does it: https://github.com/pandoc/dockerfiles/blob/master/ubuntu/Dockerfile#L167

and you launch it like this

docker run  -v `pwd`:/data pandoc/latex foo.md

The point is to mount the current directory and use the docker image as binary command inside that directory

In that case, I’m open to changing the Dockerfile’s default WORKDIR, especially since as @MindaugasLaganeckas said, there’s a low chance of it breaking anything, and it definitely does make using the docker image easier! 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set absolute path for docker entrypoint · a56aaea410 - OpenDev
In case dragonflow is used as a base image for another docker image, and the WORKDIR is set to something other than /opt/dragonflow...
Read more >
docker - entrypoint file not found - Stack Overflow
I had this problem with Docker for Windows and the solution was changing the entrypoint script file from CRLF -> LF.
Read more >
Understand ENTRYPOINT - General Discussions
Hi, I followed the [example] to publish an ASP.NET Application to docker container.
Read more >
Latest docker update requires absolute path #3214 - GitHub
After the latest docker update in windows, I have to use absolute path and change some of my env file, is this expected?...
Read more >
Does one have to use absolute paths relative to the container ...
You just need to familiarize with the Dockerfile syntax (i.e. the various FROM, COPY, RUN, ENTRYPOINT, CMD, etc. statements that you can find...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found