Skip to content

Commit

Permalink
Make sure DOCKER_BUILDKIT=1 variable is set for all builds (apache#29928
Browse files Browse the repository at this point in the history
)

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.
  • Loading branch information
potiuk authored Mar 5, 2023
1 parent 4ea457a commit 0f6e0ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions dev/breeze/src/airflow_breeze/commands/ci_image_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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:
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -504,6 +504,7 @@ def run_build_production_image(
),
cwd=AIRFLOW_SOURCES_ROOT,
check=False,
env=env,
text=True,
output=output,
)
Expand All @@ -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:
Expand Down

0 comments on commit 0f6e0ee

Please sign in to comment.