Support combining --net=container:
and --dns
flags
#25386
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
--net=container:
and --dns
flags
#25386
Feature request description
Users should be allowed to decide if they wish to overwrite the DNS settings in the dependent container.
In a previous (now locked) issue it was decided to:
Originally posted by @rhatdan in #3553
(completed in #3579)
Current behavior:
podman run --rm --name testdns --dns 1.1.1.1 --net container:other alpine cat /etc/resolv.conf
Suggest potential solution
Allow combining
--net=container:
and--dns flags
.This should not overwrite the DNS settings in the other container, but only update the DNS settings in the new (testdns) container. So, the resolv.conf would need to be overlaid, or similar, instead of the current 1:1 mount.
Desired behavior:
podman run --rm --name testdns --dns 1.1.1.1 --net container:other alpine cat /etc/resolv.conf
Maybe with a warning.
Have you considered any alternatives?
Mounting a custom resolv.conf into the container:
podman run --rm --name testdns --net container:other -v $PWD/resolv.conf:/etc/resolv.conf:ro alpine cat /etc/resolv.conf
This works fine, which made me realize that this should be possible with the
--dns
flag in the first place.Additional context
No response
The text was updated successfully, but these errors were encountered: