Synology - Docker - Container IP From DHCP From My Router

Discussion room for Docker, a lightweight virtualization application that gives you the ability to run thousands of containers created by developers from all over the world on DSM
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:
https://account.synology.com/support/suppo ... p?lang=enu
2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
MRACHINI
I'm New!
I'm New!
Posts: 6
Joined: Thu Nov 23, 2017 11:46 pm

Synology - Docker - Container IP From DHCP From My Router

Postby MRACHINI » Fri Nov 24, 2017 12:05 am

Hello,

I'm trying to make each container get its own IP from my DHCP server from my router,

but basically I'm clueless, tried googling but got results related to other platforms not Synology.

any simple way of doing that ?
automatically requesting and reserving IP from DHCP would be perfect but manually assigning an IP is OK too.
syadnom
I'm New!
I'm New!
Posts: 1
Joined: Wed Dec 06, 2017 10:36 pm

Re: Synology - Docker - Container IP From DHCP From My Router

Postby syadnom » Thu Dec 07, 2017 1:14 am

bump, with more detail.


So, the terminology here is a little different than usual. Typically, a bridge is attaching the container's networking to a physical port. So selecting bridge would basically mean connecting the container to the physical network so you could dhcp an address for instance. That is different here as it's bridged to a private network in 172.x.

Now 'host' usually means connect to a network that only exists on the host system. ie, the VM can only talk to the host and the host has to forward packets in.

What I want, and I think the OP wants, is the traditional bridge where the container is connected to the LAN interface (I'm on DS218+, one ethernet port) so it can get an IP on the network.

I've tried using 'host' as it was suggested on reddit that this is 'bridge to host's interface' but I'm not able to set an IP address within the docker container. I'm running an ubuntu 16.04 image for example. I've slip-streamed the net-tools package in so I can get ifconfig (container is missing this) but I cannot set the IP.


Any suggestions?
mightbetrue
Sharp
Sharp
Posts: 167
Joined: Sun Oct 02, 2016 9:41 am

Re: Synology - Docker - Container IP From DHCP From My Router

Postby mightbetrue » Thu Dec 07, 2017 1:07 pm

a forum search should have brought you to https://forum.synology.com/enu/viewtopi ... 8&t=136957.

Container IP in a sub segment of your network segment can be done using macvlan, though forget about assinged ips from your dhcp server.
MRACHINI
I'm New!
I'm New!
Posts: 6
Joined: Thu Nov 23, 2017 11:46 pm

Re: Synology - Docker - Container IP From DHCP From My Router

Postby MRACHINI » Thu Dec 07, 2017 1:30 pm

mightbetrue wrote:a forum search should have


what did you search for exactly ? to get to this
https://forum.synology.com/enu/viewtopi ... 8&t=136957

wanna learn some technical lexical
mightbetrue
Sharp
Sharp
Posts: 167
Joined: Sun Oct 02, 2016 9:41 am

Re: Synology - Docker - Container IP From DHCP From My Router

Postby mightbetrue » Thu Dec 07, 2017 9:07 pm

search terms: docker bridge container ip
MRACHINI
I'm New!
I'm New!
Posts: 6
Joined: Thu Nov 23, 2017 11:46 pm

Re: Synology - Docker - Container IP From DHCP From My Router

Postby MRACHINI » Thu Dec 07, 2017 9:36 pm

mightbetrue wrote:search terms: docker bridge container ip

thx

Return to “Docker”

Who is online

Users browsing this forum: No registered users and 1 guest