This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 0f6e0ee611 Make sure DOCKER_BUILDKIT=1 variable is set for all builds
(#29928)
0f6e0ee611 is described below
commit 0f6e0ee611a81046838ecc852bdc84155e335ecf
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sun Mar 5 11:24:34 2023 +0100
Make sure DOCKER_BUILDKIT=1 variable is set for all builds (#29928)
The DOCKER_BUILDKIT=1 was only set in some specific cases, but since
our images are using buildkit features, we should always use
buildkit when building the images.
---
dev/breeze/src/airflow_breeze/commands/ci_image_commands.py | 6 ++++--
dev/breeze/src/airflow_breeze/commands/production_image_commands.py | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dev/breeze/src/airflow_breeze/commands/ci_image_commands.py
b/dev/breeze/src/airflow_breeze/commands/ci_image_commands.py
index 6b72895952..d37c3e313b 100644
--- a/dev/breeze/src/airflow_breeze/commands/ci_image_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/ci_image_commands.py
@@ -464,9 +464,9 @@ def run_build_ci_image(
output=output,
)
else:
+ env = os.environ.copy()
+ env["DOCKER_BUILDKIT"] = "1"
if ci_image_params.empty_image:
- env = os.environ.copy()
- env["DOCKER_BUILDKIT"] = "1"
get_console(output=output).print(
f"\n[info]Building empty CI Image for Python
{ci_image_params.python}\n"
)
@@ -502,6 +502,7 @@ def run_build_ci_image(
cwd=AIRFLOW_SOURCES_ROOT,
text=True,
check=False,
+ env=env,
output=output,
)
if build_command_result.returncode != 0 and not
ci_image_params.upgrade_to_newer_dependencies:
@@ -515,6 +516,7 @@ def run_build_ci_image(
image_params=ci_image_params,
),
cwd=AIRFLOW_SOURCES_ROOT,
+ env=env,
text=True,
check=False,
output=output,
diff --git
a/dev/breeze/src/airflow_breeze/commands/production_image_commands.py
b/dev/breeze/src/airflow_breeze/commands/production_image_commands.py
index 8cc058741b..66256b7e9e 100644
--- a/dev/breeze/src/airflow_breeze/commands/production_image_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/production_image_commands.py
@@ -482,9 +482,9 @@ def run_build_production_image(
if prod_image_params.prepare_buildx_cache:
build_command_result = build_cache(image_params=prod_image_params,
output=output)
else:
+ env = os.environ.copy()
+ env["DOCKER_BUILDKIT"] = "1"
if prod_image_params.empty_image:
- env = os.environ.copy()
- env["DOCKER_BUILDKIT"] = "1"
get_console(output=output).print(
f"\n[info]Building empty PROD Image for Python
{prod_image_params.python}\n"
)
@@ -504,6 +504,7 @@ def run_build_production_image(
),
cwd=AIRFLOW_SOURCES_ROOT,
check=False,
+ env=env,
text=True,
output=output,
)
@@ -523,6 +524,7 @@ def run_build_production_image(
cwd=AIRFLOW_SOURCES_ROOT,
check=False,
text=True,
+ env=env,
output=output,
)
if build_command_result.returncode == 0: