Closed jeromegn closed 5 months ago
Without net namespace, it should mount sysfs through bind-mount:
{
"destination": "/sys",
"type": "none",
"source": "/sys",
"options": [
"rbind",
"nosuid",
"noexec",
"nodev",
"ro"
]
},
In a net namespace, it should mount sysfs directly:
{
"destination": "/sys",
"type": "sysfs",
"source": "sysfs",
"options": [
"nosuid",
"noexec",
"nodev",
"ro"
]
},
I think it can help you.
@JCKeep thank you! That fixed it.
@JCKeep Thanks!
I've looked through the code and couldn't figure out why not using a network namespace causes an error mounting
sysfs
on/sys
:If I add the network namespace then this works. The rest of the logs are identical (except for
unshare or setnet: LinuxNamespace { typ: Network, path: None }
.I believe this is reproducible with a spec produced like:
I assume something is happening when using a network namespace that leads to
/sys
being mountable.What I'm trying to achieve: starting a container that has access to the host networking.