fix: Sharing solution to continue use CasaOS with latest docker 29 (closes #2407)#2493
Closed
deadanon wants to merge 1 commit into
Closed
fix: Sharing solution to continue use CasaOS with latest docker 29 (closes #2407)#2493deadanon wants to merge 1 commit into
deadanon wants to merge 1 commit into
Conversation
…ility (closes #2407) Docker Engine 29 dropped support for API versions below 1.25. The CasaOS ecosystem uses the Docker SDK v20.10.x which defaults to API version 1.24. Setting DOCKER_API_VERSION=1.41 in the systemd service file tells the Docker client library to use API version 1.41 (the native version for Docker 20.10), which is supported by Docker Engine 29 and all recent Docker versions. This removes the need for users to manually set DOCKER_MIN_API_VERSION=1.24 on the Docker daemon side as a workaround. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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.



Closes #2407
Summary: CasaOS ecosystem components use the Docker Engine SDK with API version 1.24 (the default of the old Docker SDK v20.10.x), which Docker Engine 29 no longer supports as it dropped API versions below 1.25
Root cause: The Docker client initialization across CasaOS components (primarily in CasaOS-AppManagement, which was split from this repo at commit 536eac7) uses client.NewClientWithOpts(client.FromEnv) without calling client.WithAPIVersionNegotiation(). The old Docker SDK v20.10.7 defaults to requesting API version 1.24 when no negotiation or explicit version is set. Docker Engine 29 removed support for API versions below 1.25, causing all Docker API calls to fail.
Approach: Two changes are needed: (1) In the CasaOS-AppManagement repository (where service/docker.go was migrated), update the Docker SDK dependency from v20.10.7 to a current version (e.g., v25.x or v27.x) and add client.WithAPIVersionNegotiation() to every NewClientWithOpts call so the client automatically negotiates a compatible API version with the running Docker daemon. (2) In this main CasaOS repository, update the go.mod dependency on CasaOS-Common and CasaOS-AppManagement to pull in the fixed versions. The systemd service file could also be updated to set Environment=DOCKER_API_VERSION=1.46 as a belt-and-suspenders measure.
Automated fix by BugBot