"sudo: unable to resolve host" when running sudo in pod #3547
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
When running
sudo
in a container within a pod, a warning similar to the following is emitted on console:This does not happen when running the same image outside of a pod, and seems to be related to the
/etc/hosts
file (see below).Steps to reproduce the issue:
Build an image derived from
ubuntu:16.04
(let this image bemyimage
, introduce a system user (e.g.myuser
) and install sudo (apt-get -yq install sudo
);Run a dummy command via sudo using the image outside any pod, and notice that the command succeeds without warning:
podman run --rm localhost/myimage:latest sudo -u myuser true
Repeat the test after adding
--pod new:test_pod
to the command line, thereby running the image inside a pod, and notice that a warning is output:podman run --pod new:test_pod --rm localhost/myimage:latest sudo -u myuser true
Describe the results you received:
The warning
sudo: unable to resolve host a0b3a5d3b2a7
is printed. Apart from that, the command seems to succeed, but I am unsure about other implications.Describe the results you expected:
No warning should be printed.
Additional information you deem important (e.g. issue happens only occasionally):
This seems to be due to the
/etc/hosts
file, see below. Without pod:With pod:
After a quick research, the following issues might be related: #1745, #2504, #3405
Output of
podman version
:Output of
podman info --debug
:Additional environment details (AWS, VirtualBox, physical, etc.):
Physical host (laptop):
The text was updated successfully, but these errors were encountered: