mirror of
https://github.com/docker/compose.git
synced 2025-07-24 06:04:57 +02:00
Merge pull request #7563 from aiordache/validate_context_endpoint
Error out when context target is not a docker engine
This commit is contained in:
commit
15c1cabdad
@ -140,6 +140,11 @@ def docker_client(environment, version=None, context=None, tls_version=None):
|
|||||||
if tls:
|
if tls:
|
||||||
context.set_endpoint("docker", host=host, tls_cfg=tls, skip_tls_verify=not verify)
|
context.set_endpoint("docker", host=host, tls_cfg=tls, skip_tls_verify=not verify)
|
||||||
|
|
||||||
|
if not context.is_docker_host():
|
||||||
|
raise UserError(
|
||||||
|
"The platform targeted with the current context is not supported.\n"
|
||||||
|
"Make sure the context in use targets a Docker Engine.\n")
|
||||||
|
|
||||||
kwargs['base_url'] = context.Host
|
kwargs['base_url'] = context.Host
|
||||||
if context.TLSConfig:
|
if context.TLSConfig:
|
||||||
kwargs['tls'] = context.TLSConfig
|
kwargs['tls'] = context.TLSConfig
|
||||||
|
@ -4,7 +4,7 @@ certifi==2020.6.20
|
|||||||
chardet==3.0.4
|
chardet==3.0.4
|
||||||
colorama==0.4.3; sys_platform == 'win32'
|
colorama==0.4.3; sys_platform == 'win32'
|
||||||
distro==1.5.0
|
distro==1.5.0
|
||||||
docker==4.2.1
|
docker==4.2.2
|
||||||
docker-pycreds==0.4.0
|
docker-pycreds==0.4.0
|
||||||
dockerpty==0.4.1
|
dockerpty==0.4.1
|
||||||
docopt==0.6.2
|
docopt==0.6.2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user