RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1914096 - Needs improvement: Building, running, and managing containers: 3.4. Sharing files between two containers
Summary: Needs improvement: Building, running, and managing containers: 3.4. Sharing f...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: Documentation
Version: ---
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 8.4
Assignee: Gabriela Nečasová
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-08 06:29 UTC by Joerg K
Modified: 2021-01-25 10:53 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-01-25 10:53:27 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github containers podman issues 7862 0 None closed Volume prune command removes used volume 2021-02-15 19:49:56 UTC

Description Joerg K 2021-01-08 06:29:18 UTC
Document URL: 
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/building_running_and_managing_containers/working-with-containers-and-pods_building-running-and-managing-containers#sharing-files-between-two-containers_building-running-and-managing-containers

Section Number and Name: 
3.4. Sharing files between two containers

Describe the issue: 
Step 2 shows how to save the mount point path to the variable for easier manipulation: $ mntPoint=$(podman volume inspect hostvolume --format {{.Mountpoint}}). This variable is beeing used in steps 5 and 10 to mount the volume into a container.

Using the volume path instead of the volume name to mount a volume into a container causes data loss when some is running `podman volume prune` to remove unused volumes. Because `podman volume prune` is not able to recognize that the volume is being in use when it was mounted using the path instead of the name.

Suggestions for improvement: 
Instead of the variable $mntPoint use the volume name 'hostvolume' from step 1 in the code blocks from step 5 and 10.

Maybe you could insert some kind of information or warning box informing about the possible danger of using the volumes path instead of its name when mounting it into a container.

This would prevent users who follow the procedure to the letter from experiencing data loss when running `podman volume prune` like I did.

Additional information: 
See Support Case 02838634 or Github [issue 7862](https://github.com/containers/podman/issues/7862) in case you need further technical detail on this.

Comment 1 Gabriela Nečasová 2021-01-20 20:15:39 UTC
Dear Joerg, 

thank you for your feedback. We fixed it according to your suggestions:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/building_running_and_managing_containers/index#sharing-files-between-two-containers_building-running-and-managing-containers

Does it resolve the issue?

Comment 2 Joerg K 2021-01-23 20:04:56 UTC
Hi Gabriela,

Thanks for reaching out.

I've tested your changes and they resolve the issue.

However, I think I've spotted a typo in step 2:

"Notice that if you run `sudo podman volume create hostvolume`, then the mount point changes to `/var/lib/containers/storage/volumes/hostroot/_data`."

In the mount path you wrote 'hostroot' instead of 'hostvolume'. From my lab I can confirm that the path is '/var/lib/containers/storage/volumes/hostvolume/_data'.

Regards,
Joerg

Comment 3 Gabriela Nečasová 2021-01-25 09:32:41 UTC
Dear Joerg,

Thank you very much for your message. 
I checked it again and yes, you are right. 

It is fixed now:

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/building_running_and_managing_containers/index#sharing-files-between-two-containers_building-running-and-managing-containers

Can we close this issue now? 

Thank you for the cooperation. 
Kind regards

Comment 4 Joerg K 2021-01-25 10:50:01 UTC
Hi Gabriela,

Thank you very much for solving this issue. The changes you made look awesome and correct. Please, go ahead and close this issue.

Regards,  
Joerg

Comment 5 Gabriela Nečasová 2021-01-25 10:53:27 UTC
Dear Joerg, 

Thank you very much for your quick response and cooperation. 
I am closing this issue. 

Kind regards, 
Gabi


Note You need to log in before you can comment on or make changes to this bug.