feat: use docker-compose library, optionally download docker-buildx, fixes #7915, fixes #8295#8234
feat: use docker-compose library, optionally download docker-buildx, fixes #7915, fixes #8295#8234
Conversation
|
Download the artifacts for this pull request:
See Testing a PR. |
5c26179 to
25b59e4
Compare
25b59e4 to
dc7e9aa
Compare
dc7e9aa to
aa23000
Compare
|
Rebased, trivial merge conflict. |
This comment was marked as outdated.
This comment was marked as outdated.
67f6a57 to
cfd2454
Compare
360c0ec to
e33b31d
Compare
bc5efef to
0beedc7
Compare
0beedc7 to
d5baad2
Compare
|
About the new private Reason: all IDEs run Docker containers in one way or another, and they won't see our privately stored I'm also a bit worried that when you run Docker Desktop, buildx shows a version like We also don't see reports of issues with the |
1c01bee to
61070f2
Compare
61070f2 to
e48ce7b
Compare
| if pullErr := PullBaseContainerImages(additionalImages, app.NoCache); pullErr != nil { | ||
| util.Warning("Unable to pull Docker images: %v", pullErr) | ||
| } |
There was a problem hiding this comment.
This goroutine was removed because it caused corrupted output in ddev start, where several processes tried to write output at the same time, for example multiple docker-compose pull operations for the same ddev/ddev-utility:latest image and ddev-ssh-agent startup output.
| // here on restore so it does not leak when compose declines to close it | ||
| // (darwin, windows) or on non-TTY exec where setupInput returns a no-op | ||
| // restore (line 96 in the same file). | ||
| func SetExecStdin(in io.ReadCloser, tty bool) (restore func(), err error) { |
There was a problem hiding this comment.
I wish it could be simpler, but we need SetExecStdin and dupStdin functions for ddev exec, especially for ddev composer create-project.
Why this is needed (TL;DR for future me)DDEV is a long-lived Go process that calls compose On Linux,
Why we can't just use
|
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
e48ce7b to
cb2b171
Compare
The Issue
ddev powerofftakes longer than it should, seems to hang after each project is stopped #8295Related:
How This PR Solves The Issue
We added a requirement for
docker-buildxin #8149. Docker Compose has required this since v2.40.2, but the requirement was only triggered when installing extra packages or using EOL PHP versions like 7.4.This PR replaces the bundled
docker-composebinary with the Docker Compose SDK and adds optional download ofdocker-buildxto$HOME/.ddev/bin.Docker Compose (SDK)
docker-composebinary to the Docker Compose Go librarycliPluginsExtraDirsis set to$HOME/.ddev/binindocker_manager.goso plugins stored there are found automatically (this only works with the SDK, not the standalone binary)docker-compose pullinddev start- the concurrent output was corrupted on first run when no Docker images were present, caused by the performance optimizations in perf: combined startup time optimizations, for #8096 #8145Docker Buildx (optional download)
docker-buildx(avoids overriding Docker Desktop's patched builds and keeps IDE compatibility)--docker-buildx-versionflag toddev config globalto optionally download a specific buildx version to$HOME/.ddev/bin/docker-buildxddev config global --docker-buildx-version=or--docker-buildx-version=systemresets to the system buildxroot.go; buildx is now checked/downloaded only inddev start,ddev version,ddev utility rebuild, andddev utility dockercheckddev utility dockercheckshows a warning when a specific buildx version is configured (useful for support requests)Other changes
ddev versionnow works when Docker is completely broken - shows all version details, reports the Docker error at the endddev confignow works without a working Docker (allows configuring a project or setting--docker-buildx-versioninddev config global)ddev poweroffoutput is significantly improved - previously showed no output while waiting, reported inddev powerofftakes longer than it should, seems to hang after each project is stopped #8295ddev utility dockerchecknow usesdockerutil.RunCLIPluginCommandinstead of callingdocker buildxdirectlyManual Testing Instructions
Buildx:
Compose:
Compare with DDEV HEAD, use
--no-cachedue to #8145 output differences):Compare
ddev poweroffoutput on DDEV HEAD vs this PR - output should now show progress instead of silence.Run Craft CMS quickstart https://docs.ddev.com/en/stable/users/quickstart/#craft-cms, it should show the usual output for
composer installand ask interactive questions, see the comment below why this is important.Automated Testing Overview
pkg/dockerutil/docker_buildx.gowith tests indocker_buildx_test.gopkg/dockerutil/docker_compose_internal_test.gofor internal compose logicdocker_compose_test.goanddocker_manager_test.gostdin_dup.go/stdin_dup_windows.gowith tests (stdin duplication for SDK integration)Release/Deployment Notes
docker-composeis no longer downloaded to$HOME/.ddev/bin- existing binaries there are ignored (I didn't add any cleanup for$HOME/.ddev/bin/docker-compose)docker-buildx-versionin~/.ddev/global_config.yamlddev start,ddev version,ddev utility rebuild,ddev utility dockercheck