| Summary: | Running `docker cp` clobbers important mount points on the host | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Stephen Gallagher <sgallagh> |
| Component: | docker | Assignee: | Daniel Walsh <dwalsh> |
| Status: | CLOSED INSUFFICIENT_DATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | urgent | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 24 | CC: | adimania, admiller, agoldste, amurdaca, ccoleman, dwalsh, ichavero, jcajka, jchaloup, lsm5, marianne, miminar, nalin, pmorie, vbatts |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-09-22 18:14:09 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Stephen Gallagher
2016-04-13 00:55:06 UTC
Vivek, any ideas what is going on here? There are lots of calls to container.UnmountVolumes in https://github.com/docker/docker/blob/master/daemon/archive.go... I'd start looking there perhaps? Note, this is blocking hack/test-end-to-end-docker.sh in OpenShift. Well you can add the slave mount to docker.service, but this will block being able to do docker run -v /source/target:shared fedora /bin/sh Right, but that presumably won't work for us. I'm guessing a better option is to stop docker from unmounting bind mounts? Question is how unmounting in container rootfs leads to unmounting of /proc/ /sys on host. I don't understand that yet. Is it because e.g /sys is bind mounted from the host into the container? container.UnmountVolumes unmounts all volumes in the container's list of mounts, which includes bind mounts. Sure, but that should just remove the bind mount and the not source of the bind mount. For example, bind mount /sys on a dir and unmount then it only unmounts that particular mount point and not source of bind mount. # mkdir /root/sys-dest # mount --bind /sys /root/sys-dest # umount /root/sys-dest Now /sys is still around and has not been unmounted. So something is going on here. Trying to debug it. I see UnmountVolume() does lazy unmount. And that probably means that all the sub mounts will be unmounted. If those submounts are shared with host then these will be unmounted on host too. So looks like when "docker cp" mounts the volume, we need to always mount them as "private" or "rprivate" so that after copying the files out of container when these mount points are unmounted, they don't destroy host's mount points. I will track down where actual mounting is taking place. Proposed a fix. https://github.com/docker/docker/pull/22009 Fixes were merged upstream and backported in fedora. This should be fixed now. Lokesh we need a new version of docker with these fixes. The docker(s) I built yesterday contains the fix for this. What version? Mark this bug as modified by that verison. Fixed into docker-1.10.3-6.git964eda6.fc24 could you please test it out? Thx This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. |