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

Dockerfiles: run tar x with --no-same-owner #167

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

nalind
Copy link
Contributor

@nalind nalind commented Apr 11, 2024

When we're extracting tar archives, always use --no-same-owner, so that ownership doesn't get set to oddball values that might have been used by the creator of those tar archives.

I'm running podman as an unprivileged user, and the default configuration can't build or pull images with content ownership UIDs or GIDs above 65536 or so. Examples that I ran into in quay.io/devfile/universal-developer-image@sha256:2364d29270cdeadb15042785411900776a0b57dadc352befcff547242dfd8eb1 include /usr/local/bin/LICENSE (301071:301071) and /usr/local/bin/tkn (in two layers, one owned by 301071:64025, the other by 0:1000640000).

With this change applied, I can pull the built image without triggering an error.

When we're extracting tar archives, always use --no-same-owner, so that
ownership doesn't get set to oddball values that might have been used by
the builder.

Signed-off-by: Nalin Dahyabhai <[email protected]>
@AObuchow
Copy link
Contributor

This looks sane to me upon quick inspection. Letting the CI tests run

@AObuchow
Copy link
Contributor

I also wonder if this is the root cause of eclipse-che/che#22799

@nalind have you pushed the resulting image build from your changes anywhere? I'd like to quickly test something :)

@nalind
Copy link
Contributor Author

nalind commented Apr 11, 2024

I also wonder if this is the root cause of eclipse-che/che#22799

Yes, this should prevent that error when pulling the image.

There's a subtle bug in how we handle parsing for heredocs in podman build that prevents it from building the image, and I hope to fix the root of that in the imagebuilder package today.

@nalind have you pushed the resulting image build from your changes anywhere? I'd like to quickly test something :)

I've pushed it to quay.io/nalind/testing:udi. Thanks!

@AObuchow
Copy link
Contributor

@nalind thank you SO much, I was really puzzled by this bug. Your fix looks good to me :)

@nalind
Copy link
Contributor Author

nalind commented Apr 11, 2024

Thanks! containers/buildah#5473 aims to fix the other problem.

Copy link
Collaborator

@svor svor 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

openshift-ci bot commented Apr 12, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: AObuchow, nalind, svor

The full list of commands accepted by this bot can be found 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

@svor svor merged commit 3d74f37 into devfile:main Apr 15, 2024
2 checks passed
@nalind nalind deleted the tar-no-same-owner branch April 15, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants