Understand the note in the compose.yaml file about the stack dir (CORRECT vs WRONG) #146
Replies: 8 comments 6 replies
-
See previous post: #35 As I said before, it is hard to explain. But you can understand it by doing it wrong: Assume that you want to store your stacks in
Where is the data? |
Beta Was this translation helpful? Give feedback.
-
(On mobile)
That doesn’t sound right and I don’t think that’s ever been my experience.
The path can be absolute or relative. If it is relative, it is resolved
from the Compose file's parent folder. If it is absolute, the path prevents
the Compose file from being portable so Compose displays a warning. In the
later case, build arguments can be specified, including an alternate
Dockerfile location.
https://docs.docker.com/compose/compose-file/build/#:~:text=The%20path%20can%20be%20absolute,including%20an%20alternate%20Dockerfile%20location
.
Could this be a platform issue? I’ve never used docker on Windows.
Otherwise I suspect this may just be a phasing or wording issue that can be
resolved with help.
Sent from Gmail Mobile
…On Wed, Nov 22, 2023 at 17:11 Louis Lam ***@***.***> wrote:
Maybe the first one.
Because docker-compose convert the relative path ./data to the absolute
path /opt/stacks/uptime-kuma/data and send it to the Docker daemon.
Because the Docker is actually in the host, so it creates
/opt/stacks/uptime-kuma/data in the host.
So that's why the stacks dir inside container has to match the host's path.
—
Reply to this email directly, view it on GitHub
<#146 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABARHVOQ63TXEHDXUV3WYDYF2PCXAVCNFSM6AAAAAA7VGFPMCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TMNBXGQ4TI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Got to say, this is the first container that I've had to do this. It does seem weird though. |
Beta Was this translation helpful? Give feedback.
-
But are you using the same absolute path on the host and the container, or
are the both different (but still absolute)?
Sent from Gmail Mobile
…On Thu, Nov 23, 2023 at 11:16 trythatagain ***@***.***> wrote:
Got to say, this is the first container that I've had to do this. It does
seem weird though.
I was a little worried as when I use OMV and you generally use the whole
drive string eg. /dev/.../directory but it's working fine using the whole
path.
—
Reply to this email directly, view it on GitHub
<#146 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABARHV5YWIBUNP5Z4EWGMTYF6AGVAVCNFSM6AAAAAA7VGFPMCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TMNJTHE2DI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I used the same on host and container. Normally I'd used full path on host
and whatever is stated for container.
The only time I change this is for my media containers, where I generally
use the folder name on the container side for ie /dev/...
/download:/download just for ease of use
…On Thu, 23 Nov 2023, 17:28 Ryan Balfanz, ***@***.***> wrote:
But are you using the same absolute path on the host and the container, or
are the both different (but still absolute)?
Sent from Gmail Mobile
On Thu, Nov 23, 2023 at 11:16 trythatagain ***@***.***> wrote:
> Got to say, this is the first container that I've had to do this. It
does
> seem weird though.
> I was a little worried as when I use OMV and you generally use the whole
> drive string eg. /dev/.../directory but it's working fine using the
whole
> path.
>
> —
> Reply to this email directly, view it on GitHub
> <
#146 (comment)>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AABARHV5YWIBUNP5Z4EWGMTYF6AGVAVCNFSM6AAAAAA7VGFPMCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TMNJTHE2DI>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#146 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUUW46BLRW4VREK6PBLTICDYF6BVPAVCNFSM6AAAAAA7VGFPMCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TMNJUGAYTQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Ok stupid question, I setup as you have recommended after trying and failing with my own folders LOL. When I setup my own folders stacks were written correctly but container volumes, I have no idea where or if they were created locally. What permissions do you put on /opt/stacks /opt/dockge? Do you leave as root and run everything as root? |
Beta Was this translation helpful? Give feedback.
-
See also: #35 |
Beta Was this translation helpful? Give feedback.
-
I think what is important, and might be what @louislam is trying to communicate, is that the container directory should match the value for Notice that a similar warning does not exist for the data dir in the example compose file Line 11 in 05191b1 I think that the warning comments should be replaced with a note that the container directory in the volume entry should match that of Or, this configurability may not even need to exist. Why might someone need to change the stacks directory in the container (or the data dir for that matter, which is not similarly configurable). |
Beta Was this translation helpful? Give feedback.
-
I do not understand the note in the
compose.yaml
file about the stack directly.dockge/compose.yaml
Lines 16 to 20 in 05191b1
What does my host directory location have to do with the location in the container? And if they don't match why/how might data be written to the wrong path?
It seems the interpretation of the comment is that they must match, but that should not need to be the case.
Beta Was this translation helpful? Give feedback.
All reactions