You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to move from Docker to Podman and from Docker Compose to Podman's kube play. In all places that I read regarding communication between two rootless containers in the same pod [1, 2, 3], the recommendation is to use localhost. This works as expected. I tried to use the name of the container instead of localhost and it also work. For example, consider play.yml as
run podman exec nginx-busybox-busybox wget localhost -O -
run podman exec nginx-busybox-busybox wget nginx -O -
Both podman exec returns
Connecting to nginx (10.89.0.5:80)
writing to stdout
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
- 100% |********************************| 615 0:00:00 ETA
written to stdout
What is the reason to use localhost instead of the name of the container? Thanks for the help.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to move from Docker to Podman and from Docker Compose to Podman's
kube play
. In all places that I read regarding communication between two rootless containers in the same pod [1, 2, 3], the recommendation is to uselocalhost
. This works as expected. I tried to use the name of the container instead oflocalhost
and it also work. For example, considerplay.yml
aspodman kube play --replace mwe.yml
podman exec nginx-busybox-busybox wget localhost -O -
podman exec nginx-busybox-busybox wget nginx -O -
Both
podman exec
returnsWhat is the reason to use
localhost
instead of the name of the container? Thanks for the help.Beta Was this translation helpful? Give feedback.
All reactions