From 1a4981a826bb94c478c6f49721396ec03e02649c Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Thu, 11 Mar 2021 19:47:26 +0100 Subject: First big articles reformatting now that I properly understand hugo --- content/blog/docker/docker-compose-bridge.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'content/blog/docker/docker-compose-bridge.md') diff --git a/content/blog/docker/docker-compose-bridge.md b/content/blog/docker/docker-compose-bridge.md index 16a823d..f460c6c 100644 --- a/content/blog/docker/docker-compose-bridge.md +++ b/content/blog/docker/docker-compose-bridge.md @@ -1,14 +1,19 @@ --- title: "Docker compose predictable bridge" -linkTitle: "Docker compose predictable bridge" date: 2018-09-25 -description: > - How to use a predefined bridge with docker compose +description: How to use a predefined bridge with docker compose +tags: + - docker + - linux --- +## The problem + By default, docker-compose will create a network with a randomly named bridge. If you are like me using a strict firewall on all your machines, this just cannot work. -You need to put your services in `network_mode: “bridge”` and add a custom `network` entry like : +## The fix + +For example if your bridge is named docbr1, you need to put your services in `network_mode: “bridge”` and add a custom `network` entry like : {{< highlight yaml >}} version: '3.0' @@ -27,5 +32,5 @@ services: networks: default: external: - name: bridge + name: docbr1 {{< /highlight >}} -- cgit v1.2.3