Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostname not added to /etc/hosts in rootless mode #3405

Closed
fkaempfer opened this issue Jun 22, 2019 · 2 comments · Fixed by #3406
Closed

hostname not added to /etc/hosts in rootless mode #3405

fkaempfer opened this issue Jun 22, 2019 · 2 comments · Fixed by #3406
Assignees
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.

Comments

@fkaempfer
Copy link

fkaempfer commented Jun 22, 2019

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

I think this is a bug, if it is not intended to work like this.

Description

Steps to reproduce the issue:

  1. $ podman run --hostname=hello alpine:latest cat /etc/hosts

Describe the results you received:
An exact copy of the host's /etc/hosts file is displayed, it does not include the container's hostname entry

Describe the results you expected:
It should include a line like this:
10.88.0.2 hello

Additional information you deem important (e.g. issue happens only occasionally):
If you run the command as root the host entry is correctly added, in root-less mode it is missing.

Output of podman version:

Version:            1.4.0
RemoteAPI Version:  1
Go Version:         go1.11.10
OS/Arch:            linux/amd64

I'm using Fedora 29. I tried also with the latest dev snapshot on another machine with the same result.

Output of podman info --debug:
Additional environment details (AWS, VirtualBox, physical, etc.):

debug:
  compiler: gc
  git commit: ""
  go version: go1.11.10
  podman version: 1.4.0
host:
  BuildahVersion: 1.8.3
  Conmon:
    package: podman-1.4.0-2.fc29.x86_64
    path: /usr/libexec/podman/conmon
    version: 'conmon version 0.2.0, commit: 80f19b1591b03dbbc53bf28b154230c7ea372281'
  Distribution:
    distribution: fedora
    version: "29"
  MemFree: 6912102400
  MemTotal: 16733937664
  OCIRuntime:
    package: runc-1.0.0-92.dev.gitc1b8c57.fc29.x86_64
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc7+dev
      commit: 7f820969cc1cc8ea3357b39f2e2e1514f71c6fec
      spec: 1.0.1-dev
  SwapFree: 8472489984
  SwapTotal: 8472489984
  arch: amd64
  cpus: 8
  hostname: *****
  kernel: 5.0.17-200.fc29.x86_64
  os: linux
  rootless: true
  uptime: 2h 12m 38.44s (Approximately 0.08 days)
registries:
  blocked: null
  insecure: null
  search:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ConfigFile: /home/******/.config/containers/storage.conf
  ContainerStore:
    number: 61
  GraphDriverName: overlay
  GraphOptions:
  - overlay.mount_program=/bin/fuse-overlayfs
  GraphRoot: /home/****/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 64
  RunRoot: /tmp/1000
  VolumePath: /home/*******/.local/share/containers/storage/volumes

I can provide this as needed, but I think this should be universally reproducible (at least somebody I asked on IRC yesterday had the exact same result).

Similar issue: #1745

The same problem exists for podman build. But there is an additional/separate issue here: /etc/hostname is not set correctly during podman build, even in root mode. In docker this all works as expected.

To test:

FROM alpine:latest
RUN cat /etc/hostname /etc/hosts

Compare

docker build .
podman build .
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 22, 2019
@rhatdan
Copy link
Member

rhatdan commented Jun 22, 2019

@giuseppe PTAL

@giuseppe
Copy link
Member

opened a PR here: #3406

giuseppe added a commit to giuseppe/libpod that referenced this issue Jun 24, 2019
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants