docker/podman unables to build ubi9 image on RHEL7

Solution Verified - Updated -

Issue

  • docker build fails on RHEL7 with UBI9 image - getaddrinfo() thread failed to start.
  • docker build on RHEL7 with UBI9 image fail with a DNS resolution error.
Step 3/5 : RUN sleep 400 &&  yum install -y vim && yum clean all
 ---> Running in be558d93748b

Updating Subscription Management repositories.
Unable to read consumer identity
Subscription Manager is operating in container mode.
Red Hat Enterprise Linux 9 for x86_64 - BaseOS  0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'rhel-9-for-x86_64-baseos-rpms':
  - Curl error (6): Couldn't resolve host name for https://cdn.redhat.com/content/dist/rhel9/9/x86_64/baseos/os/repodata/repomd.xml  [getaddrinfo() thread failed to start]
Error: Failed to download metadata for repo 'rhel-9-for-x86_64-baseos-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
Removing intermediate container be558d93748b
error: build error: The command 'sleep 400 &&  yum install -y vim && yum clean all' returned a non-zero code: 1

Environment

  • OpenShift Container Platform - 3.11
  • Docker on RHEL7 with UBI9 image

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