Docker Community Forums

Share and learn in the Docker community.

Multiple Host Lan Connections


(Tjferre) #1

Is it possible to setup multiple lan ip connections with docker for mac? as you can do you can do on linux…

Example… I would like to run two containers running on specific ip addresses coming into my mac via the host lan
docker run --detach --publish 192.168.1.230:80:80 --restart always -i -t tutum/hello-world;
docker run --detach --publish 192.168.1.231:80:80 --restart always -i -t tutum/hello-world;

However I get this error,
docker: Error response from daemon: driver failed programming external connectivity on endpoint furious_jennings (9f30dd66f53a46dbf324a6d8360f41d1d556112bfcf6af35b4af7544e7dd5263): Error starting userland proxy: listen tcp 192.168.1.230:80: bind: cannot assign requested address.

Pinata list output, … I have tried both network = nat & network = hostnet
hostname = docker
Hostname of the virtual machine endpoint, where container ports will be
exposed if using nat networking. Access it via ‘docker.local’.

:whale: hypervisor = native (memory=8, ncpu=2)
The Docker.app includes embedded hypervisors that run the virtual machines
that power the containers. This setting allows you to control which the
default one used for Linux is.

▸ native: a version of the xhyve hypervisor that uses the MacOSX
Hypervisor.framework to run container VMs. Parameters:
memory (VM memory in gigabytes), ncpu (vCPUs)

:whale: network = nat
Controls how local containers can access the external network via the
MacOS X host. This includes outbound traffic as well as publishing ports
for external access to the local containers.

▸ nat: a mode that uses the MacOS X vmnet.framework to route container
traffic to the host network via a NAT.
▸ hostnet: a mode that helps if you are using a VPN that restricts
connectivity. Activating this mode will proxy container network
packets via the Docker.app process as host socket traffic.
Parameters: docker-ipv4 (docker node), host-ipv4 (host node)

:whale: filesystem = osxfs
Controls the mode by which files from the MacOS X host and the container
filesystem are shared with each other.

▸ osxfs: a FUSE-based filesystem that bidirectionally forwards OSX
filesystem events into the container.

:whale: native/port-forwarding = true
Expose container ports on the Mac, rather than the VM

▸ true: Container ports will be exposed on the Mac
▸ false: Container ports will be exposed on the VM

:whale: daemon = run ‘pinata get daemon’ or 'pinata set daemon [@file|-]>
JSON configuration of the local Docker daemon. Configure any custom
options you need as documented in:
https://docs.docker.com/engine/reference/commandline/daemon/. Set it
directly, or a @file or - for stdin.

Thanks!


Run cannot assign requested address
(Tjferre) #2

any ideas on how to do this?