Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-92995

[podman-5.6] Podman container created through the Compat API cannot resolve names from host machine's /etc/hosts

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • rhel-9.7
    • rhel-9.6
    • podman
    • None
    • None
    • Moderate
    • 6
    • rhel-container-tools
    • 3
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • RUN 271, RUN 272, RUN 273, RUN 274, RUN 275, RUN 276
    • Unspecified
    • Unspecified
    • Unspecified
    • x86_64
    • None

      What were you trying to do that didn't work?

      Red Hat Service Interconnect uses the Compat API to manage Podman and Docker containers.

      In podman v5 on RHEL 9, we have noticed that containers created using the Compat API can no longer resolve entries added to /etc/hosts of the host machine (only on RHEL9), but it works fine on CentOS 9 (same version 5.40), Fedora (latest) and Ubuntu.

      I have also created an upstream discussion about it earlier, but it was just to provide a small reproducer for Fedora (which is not adding entries to /etc/hosts, but it is resolving them): https://github.com/containers/podman/discussions/25004 .

      On the RHEL 9, by downgrading podman to 4.9.4, containers created through the Compat API can resolve those entries (they also show up as part of the /etc/hosts file within the container).

      What is the impact of this issue to you?

      Some of our customers are currently tied to podman-4.9.4, due to this issue.

      Please provide the package NVR for which the bug is seen:

      podman-5.4.0-9.el9_6

      How reproducible is this bug?:

      There is a very simple upstream reproducer available here:
      https://github.com/containers/podman/discussions/25004

      It is easy to reproduce.

      Steps to reproduce

      1. Start the podman.socket user level service
      systemctl --user enable --now podman.socket
      
      1. Create a sample container using the Compat API
      curl -v --unix-socket /run/user/1000/podman/podman.sock \
          -X POST \
          -H "Content-Type: application/json" \
          --data-binary '{"Image":"quay.io/fedora/fedora:41","Cmd": ["tail", "-f", "/dev/null"], "Name":"my-container"}' \
          http:/d/containers/create?name=my-container
      
      1. Start the container
      podman start my-container
      
      1. Try to resolve an entry from the /etc/hosts in the host machine
      podman exec my-container getent hosts my-host-entry
      

      Expected results

      Resolve the host entry.

      Actual results

      Entry from /etc/hosts in the host machine cannot be resolved.

              atomic-bugs@redhat.com Container QE Container QE
              fgiorget@redhat.com Fernando Giorgetti
              Container Runtime Eng Bot Container Runtime Eng Bot
              Edward Shen Edward Shen
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: