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

Add copyUIDGID support for container.put_archive() #3100

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cakedan
Copy link

@cakedan cakedan commented Feb 23, 2023

It should be noted though, it will use the user passed in containers.create()/containers.run() AND the user has to be made on the host machine with the same name/uid or else it'll fail. I ran into this issue while using dind and just added in it's Dockerfile to generate the same user with the same uid. (moby/moby#34142)

User is grabbed here https://github.com/moby/moby/blob/master/pkg/idtools/idtools_unix.go#L102 from the host, so I hope in the future we can send in our own uid:gid.

Fixes #2577

Copy link
Contributor

@milas milas left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, the changes look good.

I think we just need a small unit test similar to the existing one:

def test_put_archive(self):
client = make_fake_client()
container = client.containers.get(FAKE_CONTAINER_ID)
container.put_archive('path', 'foo')
client.api.put_archive.assert_called_with(FAKE_CONTAINER_ID,
'path', 'foo')

(Want to make sure that there's coverage for the **kwargs getting passed through.)

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.

Add support for copyUIDGID option in put_archive method
2 participants