Skip to content

Instantly share code, notes, and snippets.

@martinrusev
Created June 1, 2017 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinrusev/7312612a4c1e3e7f4fb8f2cdd9934c81 to your computer and use it in GitHub Desktop.
Save martinrusev/7312612a4c1e3e7f4fb8f2cdd9934c81 to your computer and use it in GitHub Desktop.
Docker - Host bridge
# https://forums.docker.com/t/accessing-host-machine-from-within-docker-container/14248/5
docker network create -d bridge --subnet 192.168.0.0/24 --gateway 192.168.0.1 dockernet
# Now each container can connect to the host under the fixed IP 192.168.0.1.
version: '2'
services:
db:
image: some/image
networks:
- dockernet
networks:
dockernet:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment