From ce79ad784bd639537778efd377725c1b35c747eb Mon Sep 17 00:00:00 2001 From: Dan Farnsworth Date: Mon, 8 Feb 2021 16:08:33 -0700 Subject: [PATCH] Disable Docker buildkit as it doesn't support custom networks --- devlab_bench/helpers/command.py | 3 +++ devlab_bench/helpers/docker.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/devlab_bench/helpers/command.py b/devlab_bench/helpers/command.py index f1abc82..8f73d03 100644 --- a/devlab_bench/helpers/command.py +++ b/devlab_bench/helpers/command.py @@ -230,6 +230,9 @@ def run_nowait(self): subprocess_args['stderr'] = subprocess.PIPE if self.stdin: subprocess_args['stdin'] = self.stdin + #Default subprocess behavior is to use the current env vars so if a + #custom env var is requested, we should grab the current env and then + #update the env with the new ones passed in if self.env: subprocess_args['env'] = dict(os.environ) subprocess_args['env'].update(self.env) diff --git a/devlab_bench/helpers/docker.py b/devlab_bench/helpers/docker.py index 7c55ee3..9748c88 100644 --- a/devlab_bench/helpers/docker.py +++ b/devlab_bench/helpers/docker.py @@ -112,6 +112,10 @@ def build_image(self, name, tag, context, docker_file, apply_filter_label=True, ] if os.path.isfile(docker_file): with open(docker_file) as stdin: + if 'env' in kwargs: + kwargs['env'].update({'DOCKER_BUILDKIT': "0"}) + else: + kwargs['env'] = {'DOCKER_BUILDKIT': "0"} cmd_ret = Command( self.docker_bin_paths, opts,