How can I run "podman run" commands from inside of an unprivileged pod as a rootless user on OpenShift?

Solution Verified - Updated -

Issue

  • We are using our own CI/CD pipeline, such as Jenkins, and wish to run a container within an OpenShift pod in order to build container images.
  • Attempting to run rootless containers with podman run specifically within a pod on Red Hat OpenShift Container Platform 4 produces errors of various kinds when running, including but not limited to:
    • /usr/bin/slirp4netns failed: \"open(\\\"/dev/net/tun\\\"): No such file or director
    • Error: OCI runtime error: runc: runc create failed: rootless container requires user namespaces
    • Error: OCI runtime error: crun: newgidmap: gid range [0-65335) -> [1-65335) not allowed
    • sh: /home/jenkins/@tmp/durable-ffffff/jenkins-log.txt: Permission denied

Environment

  • Red Hat OpenShift Container Platform 4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content