Add --no-hostname option

Fixes: https://github.com/containers/podman/issues/25002

Also add the ability to inspect containers for
UseImageHosts and UseImageHostname.

Finally fixed some bugs in handling of --no-hosts for Pods,
which I descovered.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2025-01-13 12:05:25 -05:00
parent 04e6488315
commit 6565bde6e8
35 changed files with 160 additions and 21 deletions

View File

@ -688,7 +688,11 @@ func setVolumeAtime(mountPoint string, st os.FileInfo) error {
return nil
}
func (c *Container) makePlatformBindMounts() error {
func (c *Container) makeHostnameBindMount() error {
if c.config.UseImageHostname {
return nil
}
// Make /etc/hostname
// This should never change, so no need to recreate if it exists
if _, ok := c.state.BindMounts["/etc/hostname"]; !ok {