1

I have a docker container which is running an instance of QEMU inside of it. This particular instance of QEMU is emulating a specific virtual device that self-assigns an IP address of 192.168.0.30. The container's IP address is 172.17.0.2. I would like to expose/forward all the traffic from the container to the QEMU instance such that when I visit the container's IP address; 172.17.0.2:80, I actually talk to 192.168.0.30:80 which is the QEMU instance inside of the container. Any help would be really helpful!

Thanks!

Lexicon
  • 2,467
  • 7
  • 33
  • 41
  • You can attach container port to host port `-p 8080:8080` – trigun117 Mar 08 '18 at 20:59
  • So using -p exposes that container port to the host. What I am attempting to do is expose an IP address within the container to the host. – Lexicon Mar 09 '18 at 00:46
  • Can you share the dockerfile used? Also can't the QEMU instance bind to 0.0.0.0 instead of a specific IP. – Gokul Chandrasekaran Mar 09 '18 at 05:58
  • 3
    Possible duplicate of [How to expose docker container's ip and port to outside docker host without port mapping?](https://stackoverflow.com/questions/25036895/how-to-expose-docker-containers-ip-and-port-to-outside-docker-host-without-port) – Paul Roub Mar 09 '18 at 15:06
  • Different in that there is an emulated device inside of the docker container. Mapping the docker container does not map to the emulation running within the docker container. I think my answer will probably lay in making a iptables fwd rule inside of the container. – Lexicon Mar 11 '18 at 01:43

0 Answers0