Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion compose/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@

SUPPORTED_FILENAMES = [
'docker-compose.yml',
'docker-compose.yml.dist',
'docker-compose.yaml',
'fig.yml',
'fig.yaml',
Expand Down Expand Up @@ -109,7 +110,7 @@ def get_config_path(base_dir):

winner = candidates[0]

if len(candidates) > 1:
if len(candidates) > 1 and not (len(candidates) == 2 and candidates[1].endswith('.dist')):
log.warn("Found multiple config files with supported names: %s", ", ".join(candidates))
log.warn("Using %s\n", winner)

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ At this point, you have seen the basics of how Compose works.

## Release Notes

To see a detailed list of changes for past and current releases of Docker
To see a detailed list of changes for past and current releases of Docker
Compose, please refer to the [CHANGELOG](https://github.com/docker/compose/blob/master/CHANGELOG.md).

## Getting help
Expand Down
15 changes: 9 additions & 6 deletions tests/unit/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,7 @@ class GetConfigPathTestCase(unittest.TestCase):

files = [
'docker-compose.yml',
'docker-compose.yml.dist',
'docker-compose.yaml',
'fig.yml',
'fig.yaml',
Expand All @@ -1067,9 +1068,10 @@ class GetConfigPathTestCase(unittest.TestCase):
def test_get_config_path_default_file_in_basedir(self):
files = self.files
self.assertEqual('docker-compose.yml', get_config_filename_for_files(files[0:]))
self.assertEqual('docker-compose.yaml', get_config_filename_for_files(files[1:]))
self.assertEqual('fig.yml', get_config_filename_for_files(files[2:]))
self.assertEqual('fig.yaml', get_config_filename_for_files(files[3:]))
self.assertEqual('docker-compose.yml.dist', get_config_filename_for_files(files[1:]))
self.assertEqual('docker-compose.yaml', get_config_filename_for_files(files[2:]))
self.assertEqual('fig.yml', get_config_filename_for_files(files[3:]))
self.assertEqual('fig.yaml', get_config_filename_for_files(files[4:]))
with self.assertRaises(config.ComposeFileNotFound):
get_config_filename_for_files([])

Expand All @@ -1081,9 +1083,10 @@ def get_config_in_subdir(files):
return get_config_filename_for_files(files, subdir=True)

self.assertEqual('docker-compose.yml', get_config_in_subdir(files[0:]))
self.assertEqual('docker-compose.yaml', get_config_in_subdir(files[1:]))
self.assertEqual('fig.yml', get_config_in_subdir(files[2:]))
self.assertEqual('fig.yaml', get_config_in_subdir(files[3:]))
self.assertEqual('docker-compose.yml.dist', get_config_in_subdir(files[1:]))
self.assertEqual('docker-compose.yaml', get_config_in_subdir(files[2:]))
self.assertEqual('fig.yml', get_config_in_subdir(files[3:]))
self.assertEqual('fig.yaml', get_config_in_subdir(files[4:]))
with self.assertRaises(config.ComposeFileNotFound):
get_config_in_subdir([])

Expand Down