[build] Fix rsync failure in otel Docker builds when SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD is enabled#25328
Merged
liat-grozovik merged 1 commit intosonic-net:masterfrom Feb 18, 2026
Conversation
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…_NATIVE_DOCKERD_FOR_BUILD is enabled This is the same fix as in sonic-net#24604 to the new otel docker Signed-off-by: david.zagury <davidza@nvidia.com>
2d86aac to
cf54c64
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Pterosaur
approved these changes
Feb 3, 2026
Contributor
Author
|
/azpw run Azure.sonic-buildimage |
Collaborator
|
/AzurePipelines run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
@DavidZagury is this only for master or needed for other branches? |
liat-grozovik
approved these changes
Feb 15, 2026
Contributor
Author
|
@liat-grozovik this would be needed for 202511 as well |
FengPan-Frank
pushed a commit
to FengPan-Frank/sonic-buildimage
that referenced
this pull request
Mar 6, 2026
…_NATIVE_DOCKERD_FOR_BUILD is enabled (sonic-net#25328) This is the same fix as in sonic-net#24604 to the new otel docker - Why I did it When building SONiC with SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD=y, Docker multi-stage builds fail during rsync operations with the following error: rsync: [generator] failed to set times on "/changes-to-image": Read-only file system (30) rsync error: some files/attrs were not transferred (see previous errors) (code 23) This issue occurs specifically when: Using Docker Engine 20.10.x with BuildKit Running builds inside containers (Docker-in-Docker scenario) Accessing the host Docker daemon via socket mount Using --mount=type=bind in multi-stage Dockerfiles The root cause is that Docker BuildKit creates read-only bind mounts, and rsync with the -a flag (which includes -t for preserving times) attempts to set timestamps on the mounted directory itself, failing on the read-only mount point. This blocks builds in environments using native dockerd for build acceleration. - How I did it Use the defined in dockerfile-macros.j2 on the otel docker - How to verify it Build SONiC using SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD=y Verify Docker images build successfully Signed-off-by: david.zagury <davidza@nvidia.com> Signed-off-by: Feng Pan <fenpan@microsoft.com>
8 tasks
Collaborator
|
Cherry-pick PR to 202511: #25982 |
dprital
pushed a commit
that referenced
this pull request
Mar 19, 2026
…_NATIVE_DOCKERD_FOR_BUILD is enabled (#25328) This is the same fix as in #24604 to the new otel docker - Why I did it When building SONiC with SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD=y, Docker multi-stage builds fail during rsync operations with the following error: rsync: [generator] failed to set times on "/changes-to-image": Read-only file system (30) rsync error: some files/attrs were not transferred (see previous errors) (code 23) This issue occurs specifically when: Using Docker Engine 20.10.x with BuildKit Running builds inside containers (Docker-in-Docker scenario) Accessing the host Docker daemon via socket mount Using --mount=type=bind in multi-stage Dockerfiles The root cause is that Docker BuildKit creates read-only bind mounts, and rsync with the -a flag (which includes -t for preserving times) attempts to set timestamps on the mounted directory itself, failing on the read-only mount point. This blocks builds in environments using native dockerd for build acceleration. - How I did it Use the defined in dockerfile-macros.j2 on the otel docker - How to verify it Build SONiC using SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD=y Verify Docker images build successfully Signed-off-by: david.zagury <davidza@nvidia.com> Signed-off-by: dprital <drorp@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the same fix as in #24604 to the new otel docker
Why I did it
When building SONiC with
SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD=y, Docker multi-stage builds fail during rsync operations with the following error:This issue occurs specifically when:
--mount=type=bindin multi-stage DockerfilesThe root cause is that Docker BuildKit creates read-only bind mounts, and rsync with the
-aflag (which includes-tfor preserving times) attempts to set timestamps on the mounted directory itself, failing on the read-only mount point.This blocks builds in environments using native dockerd for build acceleration.
Work item tracking
How I did it
Use the defined in dockerfile-macros.j2 on the otel docker
How to verify it
Build SONiC using SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD=y
Verify Docker images build successfully
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)