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

Fix multi mapping for rootless containers #381

Merged
merged 1 commit into from
Oct 14, 2021

Conversation

Furisto
Copy link
Collaborator

@Furisto Furisto commented Oct 12, 2021

This enables multi mapping for rootless containers. You need something like this in your runtime spec:

"uidMappings": [
	{
		"containerID": 0,
		"hostID": 1000,
		"size": 1
	},
	{
		"containerID": 1,
		"hostID": 100000,
		"size": 65536
	}
],
"gidMappings": [
	{
		"containerID": 0,
		"hostID": 1000,
		"size": 1
	},
	{
		"containerID": 1,
		"hostID": 100000,
		"size": 65536
	}
],

Start the container and then (in container or from the host system with the container pid)

cat /proc/self/uid_map  // or gid_map
0       1000          1
1     100000      65536

You also need to ensure that your user is allowed to map these id ranges. You can check that with

cat /etc/subuid // or subgid
furisto:100000:65536

You also need to have shadow-utils installed.

@Furisto
Copy link
Collaborator Author

Furisto commented Oct 12, 2021

Will take a look at the test errors tomorrow.

@utam0k utam0k merged commit b0f19b5 into youki-dev:main Oct 14, 2021
@Furisto Furisto linked an issue Oct 14, 2021 that may be closed by this pull request
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.

Support for rootless container
2 participants