Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] disable DOCKER_BUILDKIT if SONIC_USE_DOCKER_BUILDKIT is not set #14405

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

k-v1
Copy link
Contributor

@k-v1 k-v1 commented Mar 24, 2023

Why I did it

Fix #14081
By default DOCKER_BUILDKIT is enabled after docker version 23.0.0
So we need to disable it explicitly if SONIC_USE_DOCKER_BUILDKIT is not set.
Otherwise it will produce larger installable images.

How I did it

set DOCKER_BUILDKIT=0 in slave.mk

How to verify it

@k-v1
Copy link
Contributor Author

k-v1 commented Mar 25, 2023

It makes sense when SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD is enabled and build system is Ubuntu 22.04 or something like this with new docker version.

@k-v1
Copy link
Contributor Author

k-v1 commented Apr 8, 2023

@lguohan Could you please review this PR?

At this moment we don't use DOCKER_BUILDKIT by default because there is the old docker bug leads to larger SONiC images:

# SONIC_USE_DOCKER_BUILDKIT - use docker buildkit for build.
# If set to y SONiC build system will set environment variable DOCKER_BUILDKIT=1
# to enable docker buildkit.
# This options will speed up docker image build time.
# NOTE: SONIC_USE_DOCKER_BUILDKIT will produce larger installable SONiC image
# because of a docker bug (more details: https://github.com/moby/moby/issues/38903)
# SONIC_USE_DOCKER_BUILDKIT = y

In February docker 23 was released and DOCKER_BUILDKIT is enabled by default now in new docker versions.
At this moment it affects only builds when SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD is enabled and new docker version is installed on the build system.
In my case it was a PC with Ubuntu 22.04 and docker 23.0.1. Also I use SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD to build SONiC images. I faced this bug and it took some time to find the cause.
So I recommend to merge this fix. It doesn't affect current builds, but fix this bug when we build SONiC with new docker versions.

@lguohan
Copy link
Collaborator

lguohan commented Apr 10, 2023

thanks for explanation, approved, and will merge once test passed.

@xumia
Copy link
Collaborator

xumia commented Apr 11, 2023

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@xumia xumia enabled auto-merge (squash) April 11, 2023 02:37
@xumia xumia disabled auto-merge April 11, 2023 02:38
@xumia xumia enabled auto-merge (squash) April 11, 2023 02:39
@xumia xumia added the Build label Apr 11, 2023
@xumia xumia merged commit d7d6445 into sonic-net:master Apr 11, 2023
@k-v1 k-v1 deleted the disable_docker_buildkit_explicitly branch September 23, 2023 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable Docker BuildKit explicitly
3 participants