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

Error when starting image without /etc/hosts with base_hosts_file = "image" #24835

Open
pboguslawski opened this issue Dec 13, 2024 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@pboguslawski
Copy link

Issue Description

Docker (checked in old Debian 10) allows one to start image without /etc/hosts file without errors (i.e. when image contains only static binary).

Podman (checked 4.3.1+ds1-8+deb12u1 in Debian 12) with base_hosts_file = "image" throws error

Error: creating hosts file for container [...]: failed to create new hosts file: open /var/lib/containers/[...]/merged/etc/hosts: no such file or directory

with same image.

Steps to reproduce the issue

Steps to reproduce the issue

  1. Set base_hosts_file = "image" in containers.conf.
  2. Start container from image that does not contain /etc/hosts file.

Describe the results you received

Error is thrown and container is not started.

Describe the results you expected

Podman with base_hosts_file = "image" allows to run images with no /etc/hosts file with empty base /etc/hosts content. No error is thrown (similar to docker).

podman info output

Debian 12, amd64

# dpkg -s podman | grep Version
Version: 4.3.1+ds1-8+deb12u1

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

Additional environment details

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

@pboguslawski pboguslawski added the kind/bug Categorizes issue or PR as related to a bug. label Dec 13, 2024
@Luap99
Copy link
Member

Luap99 commented Dec 13, 2024

Can you test with the latest podman version, 4.3 is quite old now. Or can you provide a basic image where this is the case.
I have tried to reproduce this with podman run --hosts-file image ... with a locally image that does not have the hosts file in it and it still worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants