How do I use name resolution by hosts file in a Docker file?

Solution In Progress - Updated -

Issue

  • docker build ignore a hosts file in a docker host then yum install failed from yum repository in an intranet.
  • No there --add-host option in a docker build.

Environment

  • Red Hat Enterprise Linux 7
  • Docker

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