-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shared Volume getting Z propogation and permission denied in container #41
Comments
Temporary solution was to define But, that doesn't explain why the original logic failed to detect the root |
My current implementation of volumes has some serious bugs that I'm planning to solve tomorrow Converting volumes to bind make My understanding of considering shared if it's volumes section is wrong, docker-compose consider it illegal to reference a volume that is not in volumes section |
the bug is a side effect of an issue asking to prefix volumes with project name,
is expecting to find I'm pushing a temporal fix |
Ah ha, that explains it! |
would you please help me test this branch https://github.com/containers/podman-compose/tree/feature/pass-volumes
I wonder if
should it be |
No need for the |
@mheon does this apply to mount_type=bind? because the docs says it's
|
If you want to share an volume between multiple containers, then you use "z" if you want it private to one container then it is "Z". |
@rhatdan yes we know, the question is how to pass "z" or "Z" for bind and for volume (should we prefix it with for example:
or
or
or
|
Hmm. The code won't handle bind-propagation=z right now, which sounds like
a bug. Easy enough to fix.
…On Sun, Sep 15, 2019, 08:35 Muayyad Alsadi ***@***.***> wrote:
@rhatdan <https://github.com/rhatdan> yes we know, the question is how to
pass "z" or "Z" is it for bind and for volume (should we prefix it with
bind-propagation=<X>)
for example:
- --mount type=bind,source=/dir1,destination=/target,z
- --mount type=volume,source=vol1,destination=/target,z
or
- --mount type=bind,source=/dir1,destination=/target,bind-propagation=z
- --mount
type=volume,source=vol1,destination=/target,bind-propagation=z
or
- --mount type=bind,source=/dir1,destination=/target,bind-propagation=z
- --mount
type=volume,source=vol1,destination=/target,volume-propagation=z
or
- --mount type=bind,source=/dir1,destination=/target,bind-propagation=z
- --mount type=volume,source=vol1,destination=/target,z
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41?email_source=notifications&email_token=AB3AOCCJJRSJPD55NOTKXE3QJYTYPA5CNFSM4IWT6PB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6XP4MQ#issuecomment-531562034>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB3AOCCKDCHBFZANXOK5PH3QJYTYPANCNFSM4IWT6PBQ>
.
|
I would have thought --mount type=volume,source=vol1,destination=/target,z but this does not work. I am not sure if podman --mount handles the relabel at all. |
I would think the proper way to handle this would be to add relabel=private, relabel=shared, relabel=none. |
https://docs.docker.com/storage/bind-mounts/
should I revert to |
Please be so kind, and update/describe also the compose.yaml file with its volumes: section. The origin docker-compose comes with a lot of variations to delcare volumes in version 3. I started on F31 with this volume bind:
and learned in this issue, that i should use the volume syntax while reading @kevinelliott posting.Unfortunately i ended up in the well kown relabeling issue. So, what would be the out-of-box workaround with named volumes? |
I have the same problem with bitnami/mysql, the process runs with UID 1001 ( as reported inside the container), but the volume is mounted with the root as owner, and with readonly:
My docker compose file: version: "3.5"
services:
db:
restart: unless-stopped
image: bitnami/mysql:5.7
ports:
- 127.0.0.1:3309:3306
environment:
- MYSQL_ROOT_PASSWORD=xxx
- MYSQL_DATABASE=xxx
volumes:
- db:/bitnami/mysql
volumes:
db: ~ |
Strangely, when defining a shared volume (by defining it in the root level volumes and then referencing it in each service):
... the services are binding the shared volume with propagation
Z
which makes it private and unshared. The second service to mount wins, and the first no longer has access.Looking at the source at
podman-compose/podman_compose.py
Line 390 in 4c07e87
reveals that as long as the volume exists in
shared_vols
(which is defined from the rootvolumes
element in thedocker-compose.yml
), then it should getz
instead ofZ
.However, you can see from the
podman create
runs that it's passingZ
:Also, upon inspection of the containers with
podman inspect
, only the second container actually has aMounts
element listed, and it has propagation listed asrprivate
, which would restrict to that container.The first container has no
Mounts
at all.The text was updated successfully, but these errors were encountered: