Access container via hostname instead of IP address
Hi community, I use Podman on CentOS 7.9 based distro. I use ClearOS 7.9 for my needs. Now I’m dabbling with Podman and have the following question when I used Docker I could use the hostname to call for another container instead of the IP address. How is this done with Podman? I must admit I’m not very experienced with using Docker or Podman on the CLI. I know some basic stuff but enjoy learning. Regards, Marcel van Leeuwen
Hi Marcel, It might be end of day brain on my part, but I'm not sure which command you're using with an ip? Could you reply with an example Docker command that worked for you? In theory, you should be able to just replace 'docker' in your command with 'podman', and it will work. t On 8/4/21 3:15 PM, Marcel van Leeuwen via Podman wrote:
Hi community,
I use Podman on CentOS 7.9 based distro. I use ClearOS 7.9 for my needs. Now I’m dabbling with Podman and have the following question when I used Docker I could use the hostname to call for another container instead of the IP address. How is this done with Podman? I must admit I’m not very experienced with using Docker or Podman on the CLI. I know some basic stuff but enjoy learning.
Regards,
Marcel van Leeuwen _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
Marcel, Depending on your version, this should be the same as docker. I do not recall offhand what version is in RHEL7. One thing that catches people is that the default network does not have this feature enabled (just like docker). To resolve containers by their name with DNS as sudo: 1. sudo podman network create foobar 2. sudo podman run ... --net foobar --name mycontainer ... ... On Wed, Aug 4, 2021 at 3:07 PM Marcel van Leeuwen via Podman < podman@lists.podman.io> wrote:
Hi community,
I use Podman on CentOS 7.9 based distro. I use ClearOS 7.9 for my needs. Now I’m dabbling with Podman and have the following question when I used Docker I could use the hostname to call for another container instead of the IP address. How is this done with Podman? I must admit I’m not very experienced with using Docker or Podman on the CLI. I know some basic stuff but enjoy learning.
Regards,
Marcel van Leeuwen _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
participants (3)
-
Brent Baude -
Marcel van Leeuwen -
Tom Sweeney