summaryrefslogtreecommitdiff
path: root/compose/config
diff options
context:
space:
mode:
authorVitor Anjos <vitorbartier@hotmail.com>2020-06-27 15:07:32 -0300
committerUlysses Souza <ulysses.souza@docker.com>2020-08-10 10:32:45 +0200
commit17b41b27a8ab23797f5db9c0df23e1a247ebf4cc (patch)
treeba79ffab4d5640cd5751ef1a8248cd58f7a53a0a /compose/config
parentb23eb2deab5695f0749902fb127d91f5ca16f051 (diff)
Ignore build context path validation when it is not necessary
Signed-off-by: Vitor Anjos <vitorbartier@hotmail.com>
Diffstat (limited to 'compose/config')
-rw-r--r--compose/config/config.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/compose/config/config.py b/compose/config/config.py
index 90baeeaa..c7cc7240 100644
--- a/compose/config/config.py
+++ b/compose/config/config.py
@@ -729,9 +729,22 @@ def validate_extended_service_dict(service_dict, filename, service):
def validate_service(service_config, service_names, config_file):
+ def build_image():
+ args = sys.argv[1:]
+ if 'pull' in args:
+ return False
+
+ if '--no-build' in args:
+ return False
+
+ return True
+
service_dict, service_name = service_config.config, service_config.name
validate_service_constraints(service_dict, service_name, config_file)
- validate_paths(service_dict)
+
+ if build_image():
+ # We only care about valid paths when actually building images
+ validate_paths(service_dict)
validate_cpu(service_config)
validate_ulimits(service_config)