Cannot launch containers with static ip address in RHEL7

Solution Verified - Updated -

Environment

  • RHEL 7
  • Podman 1.6.4.18.el7

Issue

  • Unable to create Podman Container with static ip address in RHEL7.
  • Following error is prompted when podman container is created with static ip address:

    # podman run --rm --name test --net=mynet --ip=<ip_address> container_image
    Error: error running container create option: cannot set a static IP if joining additional CNI networks: invalid argument
    

Resolution

  • Creating a Podman container with static ip address was introduced in Podman version 1.7.0 and higher. Podman version 1.7.0 is not available for RHEL7. The feature is available inRHEL 8 provided the podman version is higher than 1.7.0

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.