Hi All,
I am struggling setting up a single host shinyproxy / docker combo.
When I start the demo application I noticed it is listening on port 20000 on all interfaces on the docker host, which is expected when using the default docker0 bridge. The solution would be to create new bridge network in docker, assign an external IP to it using com.docker.network.bridge.host_binding_ipv4 and use that for my apps.
In the documentation I found container-network
: facilities to set the networking of the container. This is the equivalent of launching the container with a --network
option (and defaults to bridge
which is also the Docker default).
I assumed that by creating a custom network and assigning it to my app using this option it would switch from the default network to the new one. What I find however is that the new network is added to the container but the default docker bridge remains next to it and is still being used for all communications. What am I doing wrong?
specs:
- id: shinyproxy-demo
display-name: ShinyProxy Demo
container-image: openanalytics/shinyproxy-demo
container-network-connections: [ "shiny-net" ]
access-groups: admins
docker network create --driver=bridge \
--subnet=172.1.0.0/16 \
--gateway=172.1.0.1 \
--internal=false \
--ingress=false \
--ipv6=false \
--attachable=false \
--opt com.docker.network.bridge.name=br-shiny-net \
--opt com.docker.network.bridge.enable_icc=false \
--opt com.docker.network.bridge.host_binding_ipv4=127.0.0.200 \
--opt com.docker.network.bridge.enable_ip_masquerade=true \
--opt com.docker.network.driver.mtu=1500 \
shiny-net
result in container:
root@60bd7dc7d1da:/# ip ad
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
36: eth0@if37: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0
valid_lft forever preferred_lft forever
38: eth1@if39: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ac:01:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.1.0.2/16 brd 172.1.255.255 scope global eth1
valid_lft forever preferred_lft forever
root@60bd7dc7d1da:/# ip ro
default via 172.17.0.1 dev eth0
172.1.0.0/16 dev eth1 proto kernel scope link src 172.1.0.2
172.17.0.0/16 dev eth0 proto kernel scope link src 172.17.0.2
root@60bd7dc7d1da:/#