diff --git a/.fossa.yml b/.fossa.yml deleted file mode 100644 index b50761ef1..000000000 --- a/.fossa.yml +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by FOSSA CLI (https://github.com/fossas/fossa-cli) -# Visit https://fossa.io to learn more - -version: 2 -cli: - server: https://app.fossa.io - fetcher: custom - project: git@github.com:docker/compose -analyze: - modules: - - name: . - type: pip - target: . - path: . diff --git a/CHANGELOG.md b/CHANGELOG.md index e8cd889f0..78f512272 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,68 @@ Change log ========== +1.25.5 (2020-02-04) +------------------- + +### Features + +- Bump OpenSSL from 1.1.1d to 1.1.1f + +- Add 3.8 compose version + +1.25.4 (2020-01-23) +------------------- + +### Bugfixes + +- Fix CI script to enforce the minimal MacOS version to 10.11 + +- Fix docker-compose exec for keys with no value + +1.25.3 (2020-01-23) +------------------- + +### Bugfixes + +- Fix CI script to enforce the compilation with Python3 + +- Fix binary's sha256 in the release page + +1.25.2 (2020-01-20) +------------------- + +### Features + +- Allow compatibility option with `COMPOSE_COMPATIBILITY` environment variable + +- Bump PyInstaller from 3.5 to 3.6 + +- Bump pysocks from 1.6.7 to 1.7.1 + +- Bump websocket-client from 0.32.0 to 0.57.0 + +- Bump urllib3 from 1.24.2 to 1.25.7 + +- Bump jsonschema from 3.0.1 to 3.2.0 + +- Bump PyYAML from 4.2b1 to 5.3 + +- Bump certifi from 2017.4.17 to 2019.11.28 + +- Bump coverage from 4.5.4 to 5.0.3 + +- Bump paramiko from 2.6.0 to 2.7.1 + +- Bump cached-property from 1.3.0 to 1.5.1 + +- Bump minor Linux and MacOSX dependencies + +### Bugfixes + +- Validate version format on formats 2+ + +- Assume infinite terminal width when not running in a terminal + 1.25.1 (2020-01-06) ------------------- diff --git a/Dockerfile b/Dockerfile index 918c6876b..1f7608e24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -ARG DOCKER_VERSION=19.03.5 -ARG PYTHON_VERSION=3.7.6 +ARG DOCKER_VERSION=19.03.8 +ARG PYTHON_VERSION=3.7.7 ARG BUILD_ALPINE_VERSION=3.11 ARG BUILD_DEBIAN_VERSION=slim-stretch -ARG RUNTIME_ALPINE_VERSION=3.11.3 -ARG RUNTIME_DEBIAN_VERSION=stretch-20191224-slim +ARG RUNTIME_ALPINE_VERSION=3.11.5 +ARG RUNTIME_DEBIAN_VERSION=stretch-20200414-slim ARG BUILD_PLATFORM=alpine diff --git a/Dockerfile.s390x b/Dockerfile.s390x deleted file mode 100644 index 9bae72d67..000000000 --- a/Dockerfile.s390x +++ /dev/null @@ -1,15 +0,0 @@ -FROM s390x/alpine:3.10.1 - -ARG COMPOSE_VERSION=1.16.1 - -RUN apk add --update --no-cache \ - python \ - py-pip \ - && pip install --no-cache-dir docker-compose==$COMPOSE_VERSION \ - && rm -rf /var/cache/apk/* - -WORKDIR /data -VOLUME /data - - -ENTRYPOINT ["docker-compose"] diff --git a/Jenkinsfile b/Jenkinsfile index 5dd1101c2..127a26c7f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ #!groovy -def dockerVersions = ['19.03.5'] +def dockerVersions = ['19.03.8'] def baseImages = ['alpine', 'debian'] def pythonVersions = ['py37'] diff --git a/README.md b/README.md index 27c8dcb34..18f7e1bc1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Docker Compose ============== ![Docker Compose](logo.png?raw=true "Docker Compose Logo") -## :exclamation: The docker-compose project announces that as Python 2 reaches it's EOL, versions 1.25.x will be the last to support it. For more information, please refer to this [issue](https://github.com/docker/compose/issues/6890). +## :exclamation: The docker-compose project announces that as Python 2 has reached it's EOL, versions 1.26.x will be the last to support it. For more information, please refer to this [issue](https://github.com/docker/compose/issues/6890). Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a Compose file to configure your application's services. diff --git a/Release.Jenkinsfile b/Release.Jenkinsfile index 953e19e4d..8aa741e56 100644 --- a/Release.Jenkinsfile +++ b/Release.Jenkinsfile @@ -1,6 +1,6 @@ #!groovy -def dockerVersions = ['19.03.5', '18.09.9'] +def dockerVersions = ['19.03.8', '18.09.9'] def baseImages = ['alpine', 'debian'] def pythonVersions = ['py37'] diff --git a/compose/cli/utils.py b/compose/cli/utils.py index 931487a6c..40bef1652 100644 --- a/compose/cli/utils.py +++ b/compose/cli/utils.py @@ -9,6 +9,7 @@ import ssl import subprocess import sys +import distro import docker import six @@ -73,7 +74,7 @@ def is_mac(): def is_ubuntu(): - return platform.system() == 'Linux' and platform.linux_distribution()[0] == 'Ubuntu' + return platform.system() == 'Linux' and distro.linux_distribution()[0] == 'Ubuntu' def is_windows(): diff --git a/compose/config/config.py b/compose/config/config.py index a5f7e35aa..444a40325 100644 --- a/compose/config/config.py +++ b/compose/config/config.py @@ -505,9 +505,7 @@ def load_services(config_details, config_file, compatibility=False, interpolate= file.get_service_dicts() for file in config_details.config_files ] - service_config = service_configs[0] - for next_config in service_configs[1:]: - service_config = merge_services(service_config, next_config) + service_config = functools.reduce(merge_services, service_configs) return build_services(service_config) diff --git a/compose/service.py b/compose/service.py index ebe237b8c..92b2b3329 100644 --- a/compose/service.py +++ b/compose/service.py @@ -1792,6 +1792,7 @@ class _CLIBuilder(object): command_builder.add_list("--cache-from", cache_from) command_builder.add_arg("--file", dockerfile) command_builder.add_flag("--force-rm", forcerm) + command_builder.add_params("--label", labels) command_builder.add_arg("--memory", container_limits.get("memory")) command_builder.add_flag("--no-cache", nocache) command_builder.add_arg("--progress", self._progress) diff --git a/requirements.txt b/requirements.txt index b1bc69442..1f78d378b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,10 @@ backports.shutil_get_terminal_size==1.0.0 backports.ssl-match-hostname==3.5.0.1; python_version < '3' cached-property==1.5.1 -certifi==2019.11.28 +certifi==2020.4.5.1 chardet==3.0.4 colorama==0.4.3; sys_platform == 'win32' +distro==1.5.0 docker==4.2.0 docker-pycreds==0.4.0 dockerpty==0.4.1 @@ -17,7 +18,7 @@ paramiko==2.7.1 pypiwin32==219; sys_platform == 'win32' and python_version < '3.6' pypiwin32==223; sys_platform == 'win32' and python_version >= '3.6' PySocks==1.7.1 -python-dotenv==0.11.0 +python-dotenv==0.13.0 PyYAML==5.3 requests==2.22.0 six==1.12.0 diff --git a/script/setup/osx b/script/setup/osx index 00cca06cf..678b7f22a 100755 --- a/script/setup/osx +++ b/script/setup/osx @@ -13,13 +13,13 @@ if ! [ ${DEPLOYMENT_TARGET} == "$(macos_version)" ]; then SDK_SHA1=dd228a335194e3392f1904ce49aff1b1da26ca62 fi -OPENSSL_VERSION=1.1.1d +OPENSSL_VERSION=1.1.1g OPENSSL_URL=https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz -OPENSSL_SHA1=056057782325134b76d1931c48f2c7e6595d7ef4 +OPENSSL_SHA1=b213a293f2127ec3e323fb3cfc0c9807664fd997 -PYTHON_VERSION=3.7.6 +PYTHON_VERSION=3.7.7 PYTHON_URL=https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -PYTHON_SHA1=4642680fbf9a9a5382597dc0e9faa058fdfd94e2 +PYTHON_SHA1=8e9968663a214aea29659ba9dfa959e8a7d82b39 # # Install prerequisites. diff --git a/setup.py b/setup.py index 548e2bc93..efc144b7f 100644 --- a/setup.py +++ b/setup.py @@ -36,10 +36,12 @@ install_requires = [ 'requests >= 2.20.0, < 3', 'texttable >= 0.9.0, < 2', 'websocket-client >= 0.32.0, < 1', + 'distro >= 1.5.0, < 2', 'docker[ssh] >= 3.7.0, < 5', 'dockerpty >= 0.4.1, < 1', 'six >= 1.3.0, < 2', 'jsonschema >= 2.5.1, < 4', + 'python-dotenv >= 0.13.0, < 1', ] diff --git a/tests/integration/service_test.py b/tests/integration/service_test.py index c50aab08b..01e2e1d22 100644 --- a/tests/integration/service_test.py +++ b/tests/integration/service_test.py @@ -985,6 +985,23 @@ class ServiceTest(DockerClientTestCase): self.addCleanup(self.client.remove_image, service.image_name) assert self.client.inspect_image('composetest_web') + def test_build_cli_with_build_labels(self): + base_dir = tempfile.mkdtemp() + self.addCleanup(shutil.rmtree, base_dir) + + with open(os.path.join(base_dir, 'Dockerfile'), 'w') as f: + f.write("FROM busybox\n") + + service = self.create_service('web', + build={ + 'context': base_dir, + 'labels': {'com.docker.compose.test': 'true'}}, + ) + service.build(cli=True) + self.addCleanup(self.client.remove_image, service.image_name) + image = self.client.inspect_image('composetest_web') + assert image['Config']['Labels']['com.docker.compose.test'] + def test_up_build_cli(self): base_dir = tempfile.mkdtemp() self.addCleanup(shutil.rmtree, base_dir)