Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow docker0 CIDR to be specified #22

Merged
merged 4 commits into from
Apr 10, 2014

Conversation

yacn
Copy link
Contributor

@yacn yacn commented Feb 24, 2014

NOTE: This pull request depends on #21

Problem

Using dvm in an environment where the default network range for Docker (172.16.42.1/24) conflicts with the local network, containers are unable to reach any hosts on the local network.

Docker allows passing in the --bip="" option to set the CIDR range for the docker0 bridge it creates. However, this alone is not enough. Since Docker will have already been started once, the docker0 bridge will already exist with the conflicting network range, causing the --bip option to take no effect.

Solution

  • To allow setting the CIDR range for the docker0 bridge, I've added the configuration directive DOCKER0_CIDR to dvm.conf.
  • To fix the issue of docker0 previously existing, the bridge-utils package is installed to provide brctl (I did check busybox first to make sure it was not already included), which is then used to remove the docker0 bridge before starting Docker with the new arguments.

Isaac Boehman added 4 commits February 24, 2014 14:59
 * bridge_utils needed to be installed
 * docker0 interface needed to be shutdown
 * docker0 interface needed to be deleted
 * args passed to docker needed to be updated
@fnichol fnichol merged commit 47922c8 into fnichol:master Apr 10, 2014
@fnichol
Copy link
Owner

fnichol commented Apr 10, 2014

Nicely done, a hairy setup but as clean as possible, given the circumstances 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants