Closed monken closed 2 years ago
Hi @monken,
Currently, podman's OCI networking doesn't play nice with libkrun's TSI (Transparent Socket Impersonation). The workaround is using host
networking with podman. Something like this should work fine:
podman run -ti --rm --net host -p 8080:80 nginx
@slp, thank you so much for your response. I really appreciate your support. I tried this before but the port mapping was ignored. I ended up being able to access the nginx server on port 80 but not on the mapped port 8080. podman ps
would also not show the port mapping.
The problem here is that we're dealing with double mapping, first by krunvm
and then by podman
. By passing -net host
to podman
, we inhibit the second mapping, meaning nginx
will listen on port 80 inside the VM. Then, we just need to configure the port mapping in krunvm
. Something like this should do the trick:
krunvm changevm LVM_NAME -p 8080:80
Then, after starting nginx
with podman
inside the lightweight VM, you should be able to access it from Safari on port 8080.
Perfect, that works. Would be nice to have native port mapping though to support running multiple containers that expose the same port.
Hi,
I've been exploring krunvm to run a podman service that I will use from my M1 MacBook. I've been able to get it to work, except that port mappings are being ignore. Here are the steps to reproduce it:
krunvm create docker.io/library/fedora:latest
podman run -ti --rm -p 8080:80 nginx
on the fedora hostPort mappings have been discarded as one of the Host, Container, Pod, and None network modes are in use
podman run -ti --rm --net podman -p 8080:80 nginx
) I get:Any help is greatly appreciated!
cat /etc/cni/net.d/87-podman.conflist
cat /etc/containers/containers.conf