Skip to content

[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
DavidZagury:master_fix_otel_prod
Feb 18, 2026
Merged

[build] Fix rsync failure in otel Docker builds when SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD is enabled#25328
liat-grozovik merged 1 commit intosonic-net:masterfrom
DavidZagury:master_fix_otel_prod

Conversation

@DavidZagury
Copy link
Copy Markdown
Contributor

@DavidZagury DavidZagury commented Feb 3, 2026

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.

Work item tracking
  • Microsoft ADO (number only):

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)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

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)

@DavidZagury DavidZagury requested a review from lguohan as a code owner February 3, 2026 13:40
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

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>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@DavidZagury
Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik liat-grozovik changed the title [build] Fix rsync failure in otel Docker builds when SONIC_CONFIG_USE… [build] Fix rsync failure in otel Docker builds when SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD is enabled Feb 15, 2026
@liat-grozovik
Copy link
Copy Markdown
Collaborator

liat-grozovik commented Feb 15, 2026

@DavidZagury is this only for master or needed for other branches?
and before merging it please update the PR description with all the missing data

@DavidZagury
Copy link
Copy Markdown
Contributor Author

@liat-grozovik this would be needed for 202511 as well
I have updated the PR description

@liat-grozovik liat-grozovik merged commit 061375b into sonic-net:master Feb 18, 2026
26 checks passed
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>
@mssonicbld
Copy link
Copy Markdown
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants