diff --git a/compose/project.py b/compose/project.py index e5b6faef3..d2787ecfc 100644 --- a/compose/project.py +++ b/compose/project.py @@ -470,16 +470,13 @@ def get_networks(service_dict, network_definitions): networks = [] for name in service_dict.pop('networks', ['default']): - if name in ['bridge']: - networks.append(name) + matches = [n for n in network_definitions if n.name == name] + if matches: + networks.append(matches[0].full_name) else: - matches = [n for n in network_definitions if n.name == name] - if matches: - networks.append(matches[0].full_name) - else: - raise ConfigurationError( - 'Service "{}" uses an undefined network "{}"' - .format(service_dict['name'], name)) + raise ConfigurationError( + 'Service "{}" uses an undefined network "{}"' + .format(service_dict['name'], name)) return networks diff --git a/docs/compose-file.md b/docs/compose-file.md index 6b61755f2..afef0b1a3 100644 --- a/docs/compose-file.md +++ b/docs/compose-file.md @@ -472,11 +472,6 @@ Networks to join, referencing entries under the - some-network - other-network -The value `bridge` can also be used to make containers join the pre-defined -`bridge` network. - -There is no equivalent to `net: "container:[name or id]"`. - ### pid pid: "host" diff --git a/requirements.txt b/requirements.txt index ed3b86869..68ef9f351 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ PyYAML==3.11 cached-property==1.2.0 -docker-py==1.7.0rc2 +docker-py==1.7.0rc3 docopt==0.6.1 enum34==1.0.4 git+https://github.com/d11wtq/dockerpty.git@29b1394108b017ef3e3deaf00604a9eb99880d5e#egg=dockerpty diff --git a/tests/acceptance/cli_test.py b/tests/acceptance/cli_test.py index 4b560efa1..30589bad7 100644 --- a/tests/acceptance/cli_test.py +++ b/tests/acceptance/cli_test.py @@ -495,22 +495,6 @@ class CLITestCase(DockerClientTestCase): assert 'Service "web" uses an undefined network "foo"' in result.stderr - @v2_only() - def test_up_with_bridge_network_plus_default(self): - filename = 'bridge.yml' - - self.base_dir = 'tests/fixtures/networks' - self._project = get_project(self.base_dir, [filename]) - - self.dispatch(['-f', filename, 'up', '-d'], None) - - container = self.project.containers()[0] - - assert sorted(list(container.get('NetworkSettings.Networks'))) == sorted([ - 'bridge', - self.project.default_network.full_name, - ]) - @v2_only() def test_up_with_network_mode(self): c = self.client.create_container('busybox', 'top', name='composetest_network_mode_container')