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

Stop putting user.overlay.* into container layer #1847

Merged
merged 1 commit into from
Feb 29, 2024
Merged

Stop putting user.overlay.* into container layer #1847

merged 1 commit into from
Feb 29, 2024

Conversation

ChristopherHX
Copy link
Contributor

@ChristopherHX ChristopherHX commented Feb 28, 2024

EDIT its this known limitation of docker 25: https://docs.docker.com/engine/release-notes/25.0/#known-limitations

To reprodce the bug caused by this attribute in docker rootless dind containers you can do

containerid="$(docker run -d --privileged --rm -it docker:dind-rootless)"
docker exec -it "$containerid" sh
DOCKER_HOST=unix:///var/run/user/1000/docker.sock docker run --rm -it  ghcr.io/catthehacker/ubuntu:act-latest-20240222
Unable to find image 'ghcr.io/catthehacker/ubuntu:act-latest-20240222' locally
act-latest-20240222: Pulling from catthehacker/ubuntu
6ddad66377a0: Already exists 
a8ffa4da65b6: Already exists 
6f031e49d16f: Already exists 
e8bedde87c3d: Already exists 
d1f12f89b682: Extracting  204.5MB/204.5MB
4ca545ee6d5d: Download complete 
docker: failed to register layer: lsetxattr user.overlay.origin /etc: operation not supported.
See 'docker run --help'.

The old image was built with buildah release included in ubuntu 22.04

The newer image ghcr.io/catthehacker/ubuntu:act-latest-20240228 is built with a patched buildah and works without issues

References

It is possible that this is a bug in docker 25.x and not here, since older dind rootless images with 24.x and older are working

In the meantime I built my images with a fork of buildah using this patch, it is up to you to decide if this is a good or bad change.

Signed-off-by: Christopher Homberger <christopher.homberger@web.de>
Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

openshift-ci bot commented Feb 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ChristopherHX, giuseppe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhatdan
Copy link
Member

rhatdan commented Feb 29, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Feb 29, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit eadc620 into containers:main Feb 29, 2024
18 checks passed
@ChristopherHX ChristopherHX deleted the no-users-overlay-xattr branch March 1, 2024 19:59
@ChristopherHX
Copy link
Contributor Author

Thank you for reviewing / merging my patch.

I have verified that latest buildah now works as expected from my side, I'm just attaching more information to this PR for others finding this change. The PR description didn't provide steps to create such an breaking image with buildah.

These steps for old buildah releases (like buildah version 1.23.1 (image-spec 1.0.1, runtime-spec 1.0.2-dev) as of ubuntu 22.04 like GitHub Hosted Runners / release-1.34) were enough to have those user.overlay.* xattr in several places, tar command for verify, no need for docker

buildah from ubuntu:latest
buildah run ubuntu-working-container apt-get update
buildah run ubuntu-working-container apt-get install -y xattr
buildah run ubuntu-working-container sh -c "echo "TEST" > /etc/test.txt"
buildah commit ubuntu-working-container
buildah images
buildah push <shafromimages> oci:layout:test:test
tar --xattrs --xattrs-include='*' -tvvf layout/blobs/sha256/<shaoflayer-added-by-buildah>

tar output of buildah before containers/buildah@662908f

drwxr-xr-x* root/root         0 2024-03-01 17:09 usr/lib/
  x: 1 user.overlay.impure
  x: 0 user.overlay.origin

the rootless docker dind has problems applying this attribute

Some backlinks for changes on docker side

@GrimzEcho
Copy link

Context for others who might discover this while attempting to pull images via rootless docker.

The v25 release of Docker engine made a bugfix so that "Unpacking layers with extended attributes onto an incompatible filesystem will now fail instead of silently discarding extended attributes." (https://github.com/moby/moby/releases/tag/v25.0.0). However, rootless docker with the native overlay storage driver (docker calls it overlay2) cannot run lsetxattr.

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.

4 participants