Migrate docker SDK to moby - CVE fix#242
Merged
carole-lavillonniere merged 1 commit intoMay 12, 2026
Merged
Conversation
be58e38 to
4d40e37
Compare
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.
Motivation
Trivy reported 2 vulnerabilities (GHSA-x744-4wpc-v9h2, GHSA-pxq6-2prw-chj9) in
github.com/docker/docker v28.5.2+incompatible, both fixed upstream in Docker Engine v29.3.1. Direct version bump is not possible: v29 only exists underdocker-vX.Y.Zgit tags (Go proxy ignores the prefix) and upstream renamed the Go module togithub.com/moby/moby/v2. The SDK has been extracted into separateclientandapimodules — switching to those picks up the fix. govulncheck confirms reachability of both CVEs in the lstk binary today, so silencing in Trivy without code change was not a defensible option.Changes
github.com/docker/dockerwithgithub.com/moby/moby/{client,api,api/pkg/stdcopy}; dropgithub.com/docker/go-connections(port types now inmoby/api/types/network)Clientmethod to the new(opts T) (Result, error)shape: Ping, Info, ImagePull, ContainerCreate/Start/Stop/Remove/Inspect/Logs/List, ImageTag, ImageRemoveContainerExecCreate/ContainerExecStart→ExecCreate/ExecStartfilters.NewArgs(filters.Arg(...))→make(client.Filters).Add(...)nat.Port{Set,Map,Binding}→network.{MustParsePort,PortSet,PortMap,PortBinding}(HostIPnownetip.Addr)Tests
make build,make test(393 tests),make lintall passgovulncheck -mode=binary bin/lstk: both DRG-838 CVEs no longer detectedlstk start,lstk logs,lstk stop)Todo
moby/moby/clientships a stable v1 — currently onv0.4.1(beta-line, but same code as Docker Engine v29.4.x in production)Closes DRG-838