mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
rootless: support podman network create
(CNI-in-slirp4netns)
Usage: ``` $ podman network create foo $ podman run -d --name web --hostname web --network foo nginx:alpine $ podman run --rm --network foo alpine wget -O - http://web.dns.podman Connecting to web.dns.podman (10.88.4.6:80) ... <h1>Welcome to nginx!</h1> ... ``` See contrib/rootless-cni-infra for the design. Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
@ -957,8 +957,10 @@ func (c *Container) completeNetworkSetup() error {
|
||||
if err := c.syncContainer(); err != nil {
|
||||
return err
|
||||
}
|
||||
if c.config.NetMode.IsSlirp4netns() {
|
||||
if rootless.IsRootless() {
|
||||
return c.runtime.setupRootlessNetNS(c)
|
||||
} else if c.config.NetMode.IsSlirp4netns() {
|
||||
return c.runtime.setupSlirp4netns(c)
|
||||
}
|
||||
if err := c.runtime.setupNetNS(c); err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user