PODMAN: Unable to assign IP to a container

Viewed 698

I am testing an application and trying to assign an IP to a container but it kept on failing with the following messages:

# podman create \
   --hostname test1 \
   --name test1 \
   --net test_nw \
   --ip 172.16.1.90 \
   oraclelinux:7
Error: error running container create option: cannot set a static IP if
joining additional CNI networks: invalid argument

Following is the network configuration:

# cat /etc/cni/net.d/88-racpub-bridge.conflist
{
    "cniVersion": "0.3.0",
    "name": "test_nw",
    "plugins": [
      {
        "type": "bridge",
        "bridge": "cni0",
        "isGateway": true,
        "ipMasq": true,
        "ipam": {
            "type": "host-local",
            "subnet": "172.16.1.0/24",
            "routes": [
                { "dst": "0.0.0.0/0" }
            ]
        }
      },
      {
        "type": "portmap",
        "capabilities": {
          "portMappings": true
        }
      }
    ]
}
0 Answers
Related