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

container: support whiteouts #273

Closed
cgwalters opened this issue Mar 28, 2022 · 1 comment · Fixed by #359
Closed

container: support whiteouts #273

cgwalters opened this issue Mar 28, 2022 · 1 comment · Fixed by #359

Comments

@cgwalters
Copy link
Member

The use case for removing stuff is in general IMO pretty weak, but it's going to confuse people and break things until we honor whiteouts on the container side.

e.g.

RUN touch /etc/foo
RUN rm /etc/foo

Or just e.g.:

RUN rm /usr/lib/systemd/system/foo.service
@cgwalters
Copy link
Member Author

cgwalters commented Aug 25, 2022

The lack of this is actually breaking coreos/layering-examples@3118caf

[core@cosa-devsh ~]$ ls -al /usr/lib/modules
total 12
drwxr-xr-x.  4 root root  118 Jan  1  1970 .
drwxr-xr-x. 38 root root 4096 Jan  1  1970 ..
drwxr-xr-x.  7 root root 4096 Jan  1  1970 4.18.0-372.19.1.el8_6.x86_64
drwxr-xr-x.  7 root root 4096 Jan  1  1970 4.18.0-372.24.1.el8_6.x86_64
----------.  1 root root    0 Aug 25 00:37 .wh.4.18.0-372.19.1.el8_6.x86_64
[core@cosa-devsh ~]$

cgwalters added a commit to cgwalters/ostree-rs-ext that referenced this issue Aug 25, 2022
A long time ago, in a galaxy far far away, a few of us in the
ostree space did some initial work on Docker-related things; specifically
support for whiteouts landed in
ostreedev/ostree@baaf745

I wish at that time we'd realized how we could more natively
support fetching containers; but, it never occurred to me to fork
off skopeo to do all the heavy lifting for the *fetch* side, which
would have been a lot of work to reimplement particularly in C.
Oh well, better late than never!

Anyways, that whiteout processing was only designed to happen at
checkout time - i.e. when materializing the final filesystem tree.  I
think this was actually a misdesign and we should add
`ostree_mutable_tree_write_with_whiteouts` so that the whiteouts
are processed in-memory.

However for now, there's a relatively low cost to temporarily
materializing the merged tree via hardlinks and handle whiteouts
via the existing code, so let's do that.

Closes: ostreedev#273
cgwalters added a commit to cgwalters/ostree-rs-ext that referenced this issue Aug 25, 2022
A long time ago, in a galaxy far far away, a few of us in the
ostree space did some initial work on Docker-related things; specifically
support for whiteouts landed in
ostreedev/ostree@baaf745

I wish at that time we'd realized how we could more natively
support fetching containers; but, it never occurred to me to fork
off skopeo to do all the heavy lifting for the *fetch* side, which
would have been a lot of work to reimplement particularly in C.
Oh well, better late than never!

Anyways, that whiteout processing was only designed to happen at
checkout time - i.e. when materializing the final filesystem tree.  I
think this was actually a misdesign and we should add
`ostree_mutable_tree_write_with_whiteouts` so that the whiteouts
are processed in-memory.

However for now, there's a relatively low cost to temporarily
materializing the merged tree via hardlinks and handle whiteouts
via the existing code, so let's do that.

Closes: ostreedev#273
cgwalters added a commit to cgwalters/ostree-rs-ext that referenced this issue Aug 25, 2022
A long time ago, in a galaxy far far away, a few of us in the
ostree space did some initial work on Docker-related things; specifically
support for whiteouts landed in
ostreedev/ostree@baaf745

I wish at that time we'd realized how we could more natively
support fetching containers; but, it never occurred to me to fork
off skopeo to do all the heavy lifting for the *fetch* side, which
would have been a lot of work to reimplement particularly in C.
Oh well, better late than never!

Anyways, that whiteout processing was only designed to happen at
checkout time - i.e. when materializing the final filesystem tree.  I
think this was actually a misdesign and we should add
`ostree_mutable_tree_write_with_whiteouts` so that the whiteouts
are processed in-memory.

However for now, there's a relatively low cost to temporarily
materializing the merged tree via hardlinks and handle whiteouts
via the existing code, so let's do that.

Closes: ostreedev#273
cgwalters added a commit to cgwalters/ostree-rs-ext that referenced this issue Aug 26, 2022
A long time ago, in a galaxy far far away, a few of us in the
ostree space did some initial work on Docker-related things; specifically
support for whiteouts landed in
ostreedev/ostree@baaf745

I wish at that time we'd realized how we could more natively
support fetching containers; but, it never occurred to me to fork
off skopeo to do all the heavy lifting for the *fetch* side, which
would have been a lot of work to reimplement particularly in C.
Oh well, better late than never!

Anyways, that whiteout processing was only designed to happen at
checkout time - i.e. when materializing the final filesystem tree.  I
think this was actually a misdesign and we should add
`ostree_mutable_tree_write_with_whiteouts` so that the whiteouts
are processed in-memory.

However for now, there's a relatively low cost to temporarily
materializing the merged tree via hardlinks and handle whiteouts
via the existing code, so let's do that.

Closes: ostreedev#273
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 a pull request may close this issue.

1 participant