Skip to content

[docker] Fix Docker commands hanging before docker.service starts#25398

Merged
lguohan merged 3 commits intosonic-net:masterfrom
Chiranjeevi-U-ML:fix/docker-socket-activation-25383
Feb 14, 2026
Merged

[docker] Fix Docker commands hanging before docker.service starts#25398
lguohan merged 3 commits intosonic-net:masterfrom
Chiranjeevi-U-ML:fix/docker-socket-activation-25383

Conversation

@Chiranjeevi-U-ML
Copy link
Contributor

Why I did it

Fix Docker socket activation broken since PR #2417 (January 2019). Docker commands executed before docker.service starts hang indefinitely because -H unix:// breaks systemd socket activation.

Fixes #25383

Work item tracking
  • Microsoft ADO (number only):

How I did it

Changed -H unix:// to -H fd:// in files/docker/docker.service.conf. Added documentation comments explaining why this flag is required to prevent future regression.

How to verify it

Verified on VS image:

  • docker.socket is active and triggers docker.service
  • dockerd runs with -H fd:// flag
  • Socket activation works correctly

Which release branch to backport (provide reason below if selected)

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

Reason: This is a bug fix that has existed since January 2019. All active release branches are affected and should receive this fix.

Tested branch (Please provide the tested image version)

  • master : fix_docker-socket-activation-25383.0-b01504e6c (sonic-vs.img.gz)

Description for the changelog

Fix Docker socket activation hang by using -H fd:// instead of -H unix:// in docker.service.conf

Link to config_db schema for YANG module changes

N/A

A picture of a cute animal (not mandatory but encouraged)

michael-sum-LEpfefQf4rU-unsplash

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 9, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: lguohan / name: Guohan Lu (32be70c)

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Chiranjeevi-U-ML Chiranjeevi-U-ML marked this pull request as draft February 10, 2026 12:17
@Chiranjeevi-U-ML Chiranjeevi-U-ML changed the title [docker] Fix docker socket activation [docker] Fix Docker commands hanging before docker.service starts Feb 10, 2026
@Chiranjeevi-U-ML Chiranjeevi-U-ML marked this pull request as ready for review February 10, 2026 12:18
@vmittal-msft
Copy link
Contributor

@make1980 please help check this,

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates SONiC’s Docker systemd drop-in so Docker socket activation works correctly during early boot, preventing docker client commands from hanging before docker.service starts.

Changes:

  • Switch dockerd host argument from -H unix:// to -H fd:// to restore systemd socket activation behavior.
  • Add explanatory comments documenting why fd:// is required to avoid regressions.

Copy link
Collaborator

@qiluo-msft qiluo-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Please keep open for some days for more reviewers.

@dgsudharsan
Copy link
Collaborator

@qiluo-msft @saiarcot895 Can we merge this?

@lguohan lguohan merged commit d050ebb into sonic-net:master Feb 14, 2026
32 checks passed
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202511: #25503

@Chiranjeevi-U-ML Chiranjeevi-U-ML deleted the fix/docker-socket-activation-25383 branch February 15, 2026 03:48
FengPan-Frank pushed a commit to FengPan-Frank/sonic-buildimage that referenced this pull request Mar 6, 2026
sonic-net#25398)

Why I did it
Fix Docker socket activation broken since PR sonic-net#2417 (January 2019). Docker commands executed before docker.service starts hang indefinitely because -H unix:// breaks systemd socket activation.

Fixes sonic-net#25383

Work item tracking
Microsoft ADO (number only):
How I did it
Changed -H unix:// to -H fd:// in files/docker/docker.service.conf. Added documentation comments explaining why this flag is required to prevent future regression.

How to verify it
Verified on VS image:

docker.socket is active and triggers docker.service
dockerd runs with -H fd:// flag
Socket activation works correctly

Signed-off-by: Chiranjeevi U <[email protected]>
Signed-off-by: Feng Pan <[email protected]>
dprital pushed a commit that referenced this pull request Mar 19, 2026
#25398)

Why I did it
Fix Docker socket activation broken since PR #2417 (January 2019). Docker commands executed before docker.service starts hang indefinitely because -H unix:// breaks systemd socket activation.

Fixes #25383

Work item tracking
Microsoft ADO (number only):
How I did it
Changed -H unix:// to -H fd:// in files/docker/docker.service.conf. Added documentation comments explaining why this flag is required to prevent future regression.

How to verify it
Verified on VS image:

docker.socket is active and triggers docker.service
dockerd runs with -H fd:// flag
Socket activation works correctly

Signed-off-by: Chiranjeevi U <[email protected]>
Signed-off-by: dprital <[email protected]>
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.

Bug: Docker socket activation incorrectly configured in sonic

8 participants