tech687
(Tech687)
February 25, 2025, 1:35pm
1
Here are some examples
docker run --rm -v .:/data blabla...
docker run --rm -v .:/tmp blabla...
docker run --rm -v .:/root blabla...
docker run --rm -v .:/$HOME blabla...
docker run --rm -v .:/$PWD blabla...
docker run --rm -v .:/usr/local blabla...
What is the most correct method?
Searching on the internet it seems that everyone has their own school of thought…
1 Like
cavo789
(Christophe Avonture)
February 25, 2025, 6:16pm
2
Hi
What is your question ?
The left part is your host so here the current folder.
The right part is inside the container.
This said, it’s depends on your needs.
For a custom application, I’m using /app (right part), for a website /var/www,…
tech687
(Tech687)
February 26, 2025, 9:32am
3
But there are those who think differently
https://www.linux.org/threads/make-is-a-utility-for-end-users-or-for-programmers-developers.53813/#post-250877
Keep paths and volumes consistent and provide absolute paths:
If readme.md is in /home/me/, and you’re in ~ (/home/me/) don’t mount ./readme, rather mount /home/me/readme, use the same paths in you docker image, etc. So be consistent, be absolute, be safe.
cavo789
(Christophe Avonture)
February 26, 2025, 4:20pm
4
Bonjour, merci, de rien
So once again you don’t reply to questions we’re asking to you : what is your question ? What is your need.
Read my previous answer , understand it, apply it to your own situation and if you’ve something to clarify, do it here so nice people can help you.
Au revoir, bonne soirée.
1 Like
tech687
(Tech687)
February 27, 2025, 11:45am
5
to dockerize my app, what would be (within docker) the ideal root dir?
bluepuma77
(Bluepuma77)
February 27, 2025, 12:38pm
6
There is no answer, it depends on your needs. What do you want to achieve?
When you bake a bread, there is no ideal recipe, everyone prefers it a bit different.
system
(system)
Closed
March 9, 2025, 12:38pm
7
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.