Skip to content
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

*: various whiteout improvements #258

Merged
merged 2 commits into from
Sep 10, 2018
Merged

Conversation

cyphar
Copy link
Member

@cyphar cyphar commented Sep 9, 2018

Previously umoci-insert(1) was quite limited in that it would only
insert a given file or directory without having any configurability.
Something users might want is the ability to delete a path without an
unpack-repack cycle. Or they want to replace the contents of a directory
rather than merge them.

To this effect, add --whiteout and --opaque which provide the
corresponding features. --whiteout just adds a whiteout at the target
path, while --opaque adds an opaque whiteout for the target before doing
the copy.

In addition, add support for "simplified whiteouts". This change ultimately
makes our images a little bit smaller by no longer whiting-out every sub-entry
when a directory has been deleted. While this is a net benefit, the cause of
this change is a Docker breakage (which arguably added a restriction that is
contrary to the OCI specification and thus it is definitely their bug). But
to play nice (and to take the opportunity to improve some images) we can fix it
in umoci.

Fixes #257
Fixes #254
Signed-off-by: Aleksa Sarai [email protected]

@cyphar cyphar force-pushed the whiteout branch 3 times, most recently from ff0457f to 9315801 Compare September 10, 2018 03:20
This change ultimately makes our images a little bit smaller by no
longer whiting-out every sub-entry when a directory has been deleted.
While this is a net benefit, the cause of this change is a Docker
breakage (which arguably added a restriction that is contrary to the OCI
specification and thus it is definitely *their* bug). But to play nice
(and to take the opportunity to improve some images) we can fix it in
umoci.

Signed-off-by: Aleksa Sarai <[email protected]>
Previously umoci-insert(1) was quite limited in that it would only
insert a given file or directory without having any configurability.
Something users might want is the ability to delete a path without an
unpack-repack cycle. Or they want to replace the contents of a directory
rather than merge them.

To this effect, add --whiteout and --opaque which provide the
corresponding features. --whiteout just adds a whiteout at the target
path, while --opaque adds an opaque whiteout for the target before doing
the copy.

You _can_ use --whiteout and --opaque together but it's basically
useless, and Docker might complain for no good reason.

Signed-off-by: Aleksa Sarai <[email protected]>
@cyphar
Copy link
Member Author

cyphar commented Sep 10, 2018

LGTM. I've tested #254 and it no longer happens with these patches.

@cyphar cyphar merged commit 15f02ce into opencontainers:master Sep 10, 2018
cyphar added a commit that referenced this pull request Sep 10, 2018
  umoci insert: extend to support whiteouts
  umoci repack: create simplified whiteouts

LGTMs: @cyphar
Closes #258
@cyphar cyphar deleted the whiteout branch September 10, 2018 04:16
@cyphar cyphar added this to the 0.4.2 milestone Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

umoci-insert needs to support (opaque) whiteouts Bad whiteout when importing in docker
1 participant