This repository was archived by the owner on Oct 13, 2023. It is now read-only.
forked from moby/moby
-
Notifications
You must be signed in to change notification settings - Fork 420
[19.03] Add chroot back to Tar/Untar without the previously introduced regression #280
Merged
andrewhsu
merged 7 commits into
docker-archive:19.03
from
tiborvass:19.03-chroot-tar-untar-and-cp-slash-fix
Jun 17, 2019
Merged
[19.03] Add chroot back to Tar/Untar without the previously introduced regression #280
andrewhsu
merged 7 commits into
docker-archive:19.03
from
tiborvass:19.03-chroot-tar-untar-and-cp-slash-fix
Jun 17, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit 60013ba. Signed-off-by: Tibor Vass <[email protected]>
This reverts commit 96df6d4. Signed-off-by: Tibor Vass <[email protected]>
CID=$(docker create alpine) docker cp $CID:/ out Signed-off-by: Brian Goff <[email protected]> Signed-off-by: Tibor Vass <[email protected]> (cherry picked from commit 6db9f1c) Signed-off-by: Tibor Vass <[email protected]>
Signed-off-by: Tibor Vass <[email protected]> (cherry picked from commit 02f1eb8) Signed-off-by: Tibor Vass <[email protected]>
Before 7a7357d, archive.TarResourceRebase was being used to copy files and folders from the container. That function splits the source path into a dirname + basename pair to support copying a file: if you wanted to tar `dir/file` it would tar from `dir` the file `file` (as part of the IncludedFiles option). However, that path splitting logic was kept for folders as well, which resulted in weird inputs to archive.TarWithOptions: if you wanted to tar `dir1/dir2` it would tar from `dir1` the directory `dir2` (as part of IncludedFiles option). Although it was weird, it worked fine until we started chrooting into the container rootfs when doing a `docker cp` with container source set to `/` (cf 3029e76). The fix is to only do the path splitting logic if the source is a file. Unfortunately, 7a7357d added support for LCOW by duplicating some of this subtle logic. Ideally we would need to do more refactoring of the archive codebase to properly encapsulate these behaviors behind well- documented APIs. This fix does not do that. Instead, it fixes the issue inline. Signed-off-by: Tibor Vass <[email protected]> (cherry picked from commit 171538c) Signed-off-by: Tibor Vass <[email protected]>
Previously, getWalkRoot("/", "foo") would return "//foo"
Now it returns "/foo"
Signed-off-by: Tibor Vass <[email protected]>
(cherry picked from commit 7410f1a)
Signed-off-by: Tibor Vass <[email protected]>
852e7c7 to
186afe3
Compare
Member
|
Failing on To easify future backports, I think we should backport;
(But #279 ("[19.03 backport] Handle the error case when a container reattaches to the same network") has to be merged first) So;
|
For reference on why this is needed: docker-archive#280 (comment) Signed-off-by: Tibor Vass <[email protected]>
7ad2521 to
8f4b96f
Compare
Member
|
discussed with @tiborvass - well do a patch in this PR itself, and keep the other changes for 19.03.1 |
thaJeztah
approved these changes
Jun 14, 2019
Member
thaJeztah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cpuguy83
approved these changes
Jun 17, 2019
cpuguy83
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
andrewhsu
approved these changes
Jun 17, 2019
andrewhsu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
docker-jenkins
pushed a commit
to docker-archive/docker-ce
that referenced
this pull request
Jun 17, 2019
For reference on why this is needed: docker-archive/engine#280 (comment) Signed-off-by: Tibor Vass <[email protected]> Upstream-commit: 8f4b96f19e64b96df9d8c43208cefb113715ccbf Component: engine
thaJeztah
pushed a commit
to thaJeztah/docker
that referenced
this pull request
Jun 18, 2019
For reference on why this is needed: docker-archive#280 (comment) Signed-off-by: Tibor Vass <[email protected]> (cherry picked from commit 8f4b96f) Signed-off-by: Sebastiaan van Stijn <[email protected]>
docker-jenkins
pushed a commit
to docker-archive/docker-ce
that referenced
this pull request
Jun 20, 2019
For reference on why this is needed: docker-archive/engine#280 (comment) Signed-off-by: Tibor Vass <[email protected]> (cherry picked from commit 8f4b96f19e64b96df9d8c43208cefb113715ccbf) Signed-off-by: Sebastiaan van Stijn <[email protected]> Upstream-commit: 584c0857ab21895e62feac686448085113c6c977 Component: engine
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverts #275 which reverted #254 and cherry-picks the needed fix from moby#39357
Related to moby#39348