-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Prevent host.containers.internal entry inside container #13224
Comments
Is there any specific reason why we should not add this? #12807 changed this so that we the correct host ip address instead of the macvlan gateway. |
What is the use-case of host.containers.internal inside containers with macvlan networks only? The only concern is about exposing the host IP address inside the containers. My ask is to not add this entry altogether. |
host.container.internal is added for bridge and slirp4netns as well |
That makes sense for the two interface types. In case of macvlan, how I can avoid leaking the host IP to containers that works with Docker Compose? |
A friendly reminder that this issue had no activity for 30 days. |
@vikas-goel Would a containers.conf option work for you? |
Yes. |
Set the ip for the host.containers.internal entry in the containers /etc/hosts file. This can be set to "none" to disable adding this entry. By default it will automatically choose the host ip. Also add a function to get the correct host.containers.internal ip. This should be used by podman and buildah and then passed to the New() function. Ref containers/podman#13224 Signed-off-by: Paul Holzinger <[email protected]>
Set the ip for the host.containers.internal entry in the containers /etc/hosts file. This can be set to "none" to disable adding this entry. By default it will automatically choose the host ip. Also add a function to get the correct host.containers.internal ip. This should be used by podman and buildah and then passed to the New() function. Ref containers/podman#13224 Signed-off-by: Paul Holzinger <[email protected]>
Set the ip for the host.containers.internal entry in the containers /etc/hosts file. This can be set to "none" to disable adding this entry. By default it will automatically choose the host ip. Also add a function to get the correct host.containers.internal ip. This should be used by podman and buildah and then passed to the New() function. Ref containers/podman#13224 Signed-off-by: Paul Holzinger <[email protected]>
Set the ip for the host.containers.internal entry in the containers /etc/hosts file. This can be set to "none" to disable adding this entry. By default it will automatically choose the host ip. Also add a function to get the correct host.containers.internal ip. This should be used by podman and buildah and then passed to the New() function. Ref containers/podman#13224 Signed-off-by: Paul Holzinger <[email protected]>
Set the ip for the host.containers.internal entry in the containers /etc/hosts file. This can be set to "none" to disable adding this entry. By default it will automatically choose the host ip. Also add a function to get the correct host.containers.internal ip. This should be used by podman and buildah and then passed to the New() function. Ref containers/podman#13224 Signed-off-by: Paul Holzinger <[email protected]>
Set the ip for the host.containers.internal entry in the containers /etc/hosts file. This can be set to "none" to disable adding this entry. By default it will automatically choose the host ip. Also add a function to get the correct host.containers.internal ip. This should be used by podman and buildah and then passed to the New() function. Ref containers/podman#13224 Signed-off-by: Paul Holzinger <[email protected]>
Set the ip for the host.containers.internal entry in the containers /etc/hosts file. This can be set to "none" to disable adding this entry. By default it will automatically choose the host ip. Also add a function to get the correct host.containers.internal ip. This should be used by podman and buildah and then passed to the New() function. Ref containers/podman#13224 Signed-off-by: Paul Holzinger <[email protected]>
Set the ip for the host.containers.internal entry in the containers /etc/hosts file. This can be set to "none" to disable adding this entry. By default it will automatically choose the host ip. Also add a function to get the correct host.containers.internal ip. This should be used by podman and buildah and then passed to the New() function. Ref containers/podman#13224 Signed-off-by: Paul Holzinger <[email protected]>
Set the ip for the host.containers.internal entry in the containers /etc/hosts file. This can be set to "none" to disable adding this entry. By default it will automatically choose the host ip. Also add a function to get the correct host.containers.internal ip. This should be used by podman and buildah and then passed to the New() function. Ref containers/podman#13224 Signed-off-by: Paul Holzinger <[email protected]>
Set the ip for the host.containers.internal entry in the containers /etc/hosts file. This can be set to "none" to disable adding this entry. By default it will automatically choose the host ip. Also add a function to get the correct host.containers.internal ip. This should be used by podman and buildah and then passed to the New() function. Ref containers/podman#13224 Signed-off-by: Paul Holzinger <[email protected]>
Use the new logic from c/common to create the hosts file. This will help to better allign the hosts files between buildah and podman. Also this fixes several bugs: - remove host entries when container is stopped and has a netNsCtr - add entries for containers in a pod - do not duplicate entries in the hosts file - use the correct slirp ip when an userns is used Features: - configure host.containers.internal entry in containers.conf - configure base hosts file in containers.conf Fixes containers#12003 Fixes containers#13224 Signed-off-by: Paul Holzinger <[email protected]>
/kind feature
Description
Podman adds host.containers.internal entry, that maps to the host’s IP address, in containers /etc/hosts file automatically. The containers are connected to macvlan networks. This entry is not desired and behavior is different from Docker.
How can it be prevented?
Steps to reproduce the issue:
Start a container with macvlan network.
Check /etc/hosts file inside container
Describe the results you received:
host.containers.internal mapped to host’s IP address
Describe the results you expected:
No such entry should be present
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Podman 4.0RC* mainline
Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
RHEL8.5
The text was updated successfully, but these errors were encountered: