Forward traffic from container's localhost to host IP

692 Views Asked by At

I have a podman container running on my host with a public IP. If I try to access localhost:80 from container, it should get mapped to host-ip:443.

I tried to do this using port forwarding like this: podman run -it ..... -p host-ip:443:80 since in podman we need to give in host-port:container-port format. But this passes traffic from host to container only, not from container to host. I also tried with --net=host, but it replaced the container's localhost to host's localhost itself.

Even if it works on docker, kindly help me resolve it, since most commands on docker works on podman also.

0

There are 0 best solutions below