Skip to content

skip container ID remapping, if the file is overlayfs whiteout.#35822

Merged
yongtang merged 1 commit intomoby:masterfrom
keyolk:35709-fix-docker-build-overlayfs-whiteout
Jan 3, 2018
Merged

skip container ID remapping, if the file is overlayfs whiteout.#35822
yongtang merged 1 commit intomoby:masterfrom
keyolk:35709-fix-docker-build-overlayfs-whiteout

Conversation

@keyolk
Copy link
Copy Markdown
Contributor

@keyolk keyolk commented Dec 18, 2017

fixes #35709

Signed-off-by: Chanhun Jeong chanhun.jeong@navercorp.com

- What I did
during docker image build,
do check whether the file in intermediate container is overlayfs whiteout (0/0 device).
if then, skip uid/gid remapping.

- How I did it
using AUFS, dockerd skips its whiteout file,
but not for overlayfs.

- How to verify it
with userns, overlay2 storage driver,
do below,

docker build -f - . <<<$'FROM centos\nRUN ls -lad /etc/se*; rm -v /etc/services\nRUN ls -lad /etc/se*'

then check whether the file /etc/services is removed.

- Description for the changelog
skip container ID remapping, if the file is overlayfs whiteout.

- A picture of a cute animal (not mandatory but encouraged)
: - ()

@thaJeztah
Copy link
Copy Markdown
Member

ping @estesp @dmcgowan @kolyshkin PTAL

Copy link
Copy Markdown
Contributor

@estesp estesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@keyolk keyolk force-pushed the 35709-fix-docker-build-overlayfs-whiteout branch 2 times, most recently from 6e6d722 to f5c0831 Compare December 19, 2017 08:16
Copy link
Copy Markdown
Member

@yongtang yongtang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit, LGTM overall.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: looks like this line might be changed to:

isOverlayWhiteout := fi.Mode()&os.ModeCharDevice != 0 && hdr.Devmajor == 0 && hdr.Devminor == 0

?

Signed-off-by: Chanhun Jeong <chanhun.jeong@navercorp.com>
@keyolk keyolk force-pushed the 35709-fix-docker-build-overlayfs-whiteout branch from f5c0831 to b013c15 Compare January 3, 2018 08:07
Copy link
Copy Markdown
Member

@yongtang yongtang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the comment has been addressed and all tests passed, LGTM. Thanks!

@yongtang yongtang merged commit 99c22b0 into moby:master Jan 3, 2018
@keyolk keyolk deleted the 35709-fix-docker-build-overlayfs-whiteout branch January 4, 2018 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Build] File deletion does not work in userns enabled engine

5 participants