Skip to content

Instantly share code, notes, and snippets.

@ebuildy
Last active March 17, 2017 12:39
Show Gist options
  • Save ebuildy/f6adf94869038cac0797e3a7f15817ff to your computer and use it in GitHub Desktop.
Save ebuildy/f6adf94869038cac0797e3a7f15817ff to your computer and use it in GitHub Desktop.
Restrict Docker network address

Currently, Docker lets you customize only IP ranges of docker0 bridge (via BIP options), so if you run docker-compose that creates networks, you are fucked up.

Solution in progress

A merge request has been sent => https://github.com/docker/docker/pull/29376/files not yet merged

Solution for now

You can create manualy a network:

docker network create --driver=bridge --subnet=172.20.100.0/24 qwant

And use it on all your docker compose files:

networks:
  default:
    external:
      name: qwant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment