You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cli/command/container: remove dependency on cli/compose/loader.ParseVolume #6188
As an effect, users of the cli that import the container package also get all of "compose" (stack) as a dependency. We should split the volume / mount parsing logic to a separate package if possible.
I noticed this while looking what parts of docker/cli were used by compose.
Thanks! For transparency; I have not dug in deep yet to see what's involved, so there may be some fun challenges.
The main reason I opened this ticket is that we're trying to provide a cleaner "Go" API for our projects, and have a better separation between packages that are designed (or "expected") to be used by others, and those that are for local / internal use.
While looking at compose (which currently has to use some parts of the CLI codebase), I noticed that it imports the compose pacakge from docker/cli, which brings a lot of code with it that docker compose doesn't need. Some of those also involve text/template which is known to be bad or memory use, so trying to avoid that to be imported in places it's not needed where possible.
The tricky bit here may be that the current implementation of loader.ParseVolume may still need a rewrite on its own, so IDEALLY we'd keep it internal somehow (so that it doesn't become a public API that we can't change).
Input and suggestions are more than welcome; also happy to have a closer look, but feel free to make a start (but be prepared for going through a couple of iterations 😅).
Activity
mayooot commentedon Jul 22, 2025
@thaJeztah Hi, I can do it.
thaJeztah commentedon Jul 22, 2025
Thanks! For transparency; I have not dug in deep yet to see what's involved, so there may be some fun challenges.
The main reason I opened this ticket is that we're trying to provide a cleaner "Go" API for our projects, and have a better separation between packages that are designed (or "expected") to be used by others, and those that are for local / internal use.
While looking at compose (which currently has to use some parts of the CLI codebase), I noticed that it imports the compose pacakge from docker/cli, which brings a lot of code with it that docker compose doesn't need. Some of those also involve
text/templatewhich is known to be bad or memory use, so trying to avoid that to be imported in places it's not needed where possible.tree -d ./vendor/github.com/docker/cli/cli/ ./vendor/github.com/docker/cli/cli/ ├── command ... ├── compose │ ├── interpolation │ ├── loader │ ├── schema │ │ └── data │ ├── template │ └── types ...The tricky bit here may be that the current implementation of
loader.ParseVolumemay still need a rewrite on its own, so IDEALLY we'd keep it internal somehow (so that it doesn't become a public API that we can't change).Input and suggestions are more than welcome; also happy to have a closer look, but feel free to make a start (but be prepared for going through a couple of iterations 😅).