599 Commits

Author SHA1 Message Date
David Gageot
27faa3b84e test: replace os.MkdirTemp with t.TempDir()
Use t.TempDir() which automatically cleans up the temporary directory
when the test completes, eliminating the need for manual cleanup.

Go 1.14 modernization pattern.

Assisted-By: cagent
Signed-off-by: David Gageot <david.gageot@docker.com>
2026-01-20 11:34:11 +01:00
David Gageot
093205121c test: replace context.Background()/context.TODO() with t.Context()
Replace manual context creation with t.Context() which is automatically
cancelled when the test completes.

Go 1.24 modernization pattern.

Assisted-By: cagent
Signed-off-by: David Gageot <david.gageot@docker.com>
2026-01-20 11:34:11 +01:00
Nicolas De Loof
c8d687599a Fixed progress UI to adapt to terminal width
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2026-01-19 11:14:23 +01:00
tensorworker
02b606ef8e use go-compose instead Signed-off-by: tensorworker <tensorworker@proton.me>
Signed-off-by: tensorworker <tensorworker@proton.me>
2026-01-15 08:24:20 +01:00
tensorworker
9856802945 fix: expand tilde in --env-file paths to user home directory
When using --env-file=~/.env, the tilde was not expanded to the user's
home directory. Instead, it was treated as a literal character and
resolved relative to the current working directory, resulting in errors
like "couldn't find env file: /current/dir/~/.env".

This adds an ExpandUser function that expands ~ to the home directory
before converting relative paths to absolute paths.

Fixes #13508

Signed-off-by: tensorworker <tensorworker@proton.me>
2026-01-15 08:24:20 +01:00
Jan-Robin Aumann-O'Keefe
7d5913403a add service name completion to down command
Signed-off-by: Jan-Robin Aumann-O'Keefe <jan-robin@aumann.org>
2026-01-05 09:32:39 +01:00
hiroto.toyoda
d95aa57f01 fix: avoid setting timeout when waitTimeout is not positive
Signed-off-by: hiroto.toyoda <hiroto.toyoda@dena.com>
2026-01-05 09:31:14 +01:00
hiroto.toyoda
327be1fcd5 add unit test
Signed-off-by: hiroto.toyoda <hiroto.toyoda@dena.com>
2026-01-05 08:15:02 +01:00
Nicolas De Loof
d4c1987638 Prevented incorrect progress metrics to break compose display.
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-12-15 18:02:31 +01:00
Nicolas De Loof
1297f97aef prefer aec library over raw ANSI sequences
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-12-15 16:36:57 +01:00
hiroto.toyoda
55cded1806 Avoid reassigning err variable
Signed-off-by: hiroto.toyoda <hiroto.toyoda@dena.com>
2025-12-15 15:18:54 +01:00
hiroto.toyoda
6c043929a0 Fix missing error handling in setEnvWithDotEnv
Signed-off-by: hiroto.toyoda <hiroto.toyoda@dena.com>
2025-12-15 15:18:54 +01:00
Nicolas De Loof
3853ad3911 prefer *task for memory efficiency updating tasks
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-12-12 14:22:02 +01:00
Nicolas De Loof
02008a0097 Restored image layer download progress details on pull.
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-12-12 14:22:02 +01:00
Nicolas De Loof
b62cbed87c Fixed status alignment in progress UI.
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-12-11 15:25:03 +01:00
Nicolas De Loof
aa9a71f37a run finalization synchronously
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-12-10 22:49:37 +01:00
Nicolas De Loof
d12947e9f8 Fixed broken run --quiet.
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-12-08 13:34:26 +01:00
xiaolinny
0878c59a74 chore: fix grammatical errors and improve clarity in code
Signed-off-by: xiaolinny <xiaolincode@outlook.com>
2025-12-08 11:20:48 +01:00
Nicolas De Loof
c0345e4f45 restore support for COMPOSE_COMPATIBILITY
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-12-07 18:42:04 +01:00
zjumathcode
13d70b1c11 refactor: replace interface{} with any for clarity and modernization
Signed-off-by: zjumathcode <pai314159@2980.com>
2025-12-02 08:41:49 +01:00
Nicolas De Loof
72f4d655ef Bump compose go to v2.10.0
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-12-01 17:19:40 +01:00
Sebastiaan van Stijn
dc66e6bad1 golangci-lint: use gci formatter instead of goimports
Most files already grouped imports into "stdlib -> other -> local",
but some files didn't. The gci formatter is similar to goimports, but
has better options to make sure imports are grouped in the expected
order (and to make sure no additional groups are present).

This formatter has a 'fix' function, so code can be re-formatted auto-
matically;

    golangci-lint run -v --fix

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-01 12:21:50 +01:00
Nicolas De Loof
b32297dccd add --wait option to start command
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-12-01 11:58:00 +01:00
vicerace
822f5a702b refactor: replace Split in loops with more efficient SplitSeq
Signed-off-by: vicerace <vicerace@sohu.com>
2025-11-25 11:37:03 +01:00
Sebastiaan van Stijn
c47b8c32e3 Dockerfile: update golangci-lint to v2.6.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-16 14:54:58 +01:00
Sebastiaan van Stijn
89d3944837 fix linting issues
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-16 14:54:58 +01:00
Nicolas De Loof
d7e5f20eb6 images command should display image Created time or N/A if not available
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-11-13 09:40:56 +01:00
Nicolas De Loof
2b4543935c next release will be major version v5.x
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-11-13 09:32:43 +01:00
Nicolas De Loof
6e55832b1c add (restore) support for detach keys
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-11-12 14:23:58 +01:00
Nicolas De Loof
45def51117 make DRYRUN_PREFIX a display attribute, move DryRunClient out of pkg/api
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-11-12 11:17:28 +01:00
Nicolas De Loof
aff5c115d6 move progress UI components into cmd
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-11-12 11:17:28 +01:00
Nicolas De Loof
c37ede62db on up buildOptions must include all enabled services
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-11-06 16:28:46 +01:00
Nicolas De Loof
7eb5adeef6 introduce --insecure-registry, reserved for testing purpose
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-11-06 16:17:21 +01:00
Nicolas De Loof
13870006fb disable progress UI when build is ran with --print
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-11-04 17:30:56 +01:00
Nicolas De Loof
fc2a7d13fa from Compose CLI, we know the streams used to configure LogConsumer
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-11-04 10:25:14 +01:00
Guillaume Lours
b80bb0586e Migrate CLI commands to use LoadProject API
Simplifying the codebase and eliminating duplicate backend creation.

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2025-11-03 08:58:30 +01:00
Guillaume Lours
3658a063bb add AlwaysOkPrompt to replace 'AlwaysYes' current implementation'
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2025-11-03 08:01:59 +01:00
Sebastiaan van Stijn
74a4ccdd85 fix various linting issues
Got these when running locally on a more recent version of golangci-lint:

    pkg/compose/build_bake.go:187:3: importShadow: shadow of imported from 'github.com/docker/cli/cli/command/image/build' package 'build' (gocritic)
                    build := *service.Build
                    ^
    pkg/compose/build_bake.go:526:19: importShadow: shadow of imported from 'github.com/docker/cli/cli/command/image/build' package 'build' (gocritic)
    func toBakeAttest(build types.BuildConfig) []string {
                      ^
    pkg/compose/create.go:1453:2: importShadow: shadow of imported from 'github.com/docker/docker/api/types/network' package 'network' (gocritic)
            network string,
            ^
    pkg/compose/create.go:1468:2: importShadow: shadow of imported from 'github.com/docker/docker/api/types/network' package 'network' (gocritic)
            network string,
            ^
    pkg/compose/monitor.go:42:17: importShadow: shadow of imported from 'github.com/docker/compose/v2/pkg/api' package 'api' (gocritic)
    func newMonitor(api client.APIClient, project string) *monitor {
                    ^
    cmd/compose/config.go:337:1: File is not properly formatted (gofumpt)
            return
    ^
    pkg/compose/convergence.go:608:1: File is not properly formatted (gofumpt)
                    return
    ^
    pkg/compose/cp.go:335:1: File is not properly formatted (gofumpt)
                    return
    ^
    pkg/e2e/compose_up_test.go:35:10: go-require: c.RunDockerComposeCmd contains assertions that must only be used in the goroutine running the test function (testifylint)
                    res := c.RunDockerComposeCmd(t, "-f", "fixtures/dependencies/deps-completed-successfully.yaml", "--project-name", projectName, "up", "--wait", "-d")
                           ^
    pkg/e2e/healthcheck_test.go:42:10: go-require: c.RunDockerComposeCmd contains assertions that must only be used in the goroutine running the test function (testifylint)
                    res := c.RunDockerComposeCmd(t, "-f", "fixtures/start_interval/compose.yaml", "--project-name", projectName, "up", "--wait", "-d", "test")
                           ^
    10 issues:
    * gocritic: 5
    * gofumpt: 3
    * testifylint: 2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-31 17:44:38 +01:00
Nicolas De Loof
7e3993bcac skip Start[ed|ing] events to avpd mix with container logs
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-10-29 10:11:30 +01:00
Nicolas De Loof
fd4f2f99cf register TTYWritter as an Event Processor
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-10-29 10:11:30 +01:00
Guillaume Lours
86e91e010d Add streamOverrideWrapper to intercepts command.Cli stream methods and transparently returns custom streams when provided via options
Add new GetConfiguredStreams function to Compose API definition

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2025-10-27 16:17:50 +01:00
Nicolas De Loof
7f668bd7fe Setup Compose service using functional parameters
This commit introduces WithMaxConcurrency and WithDryRun to replace direct mutators on composeService
commands and flags are translated into a set of functional parameters which are eventually applied
as a ComposeService is created just before being actually used by a command

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-10-24 18:24:21 +02:00
Anton Ovchinnikov
8619f5d72a Fix help output for "exec --no-tty" option
Signed-off-by: Anton Ovchinnikov <anton@tonyo.info>
2025-10-23 18:19:41 +02:00
Nicolas De Loof
6a90742ef2 Test to check writeComposeFile detects invalid OCI artifact
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-10-22 20:09:32 +02:00
Nicolas De Loof
9b4fcce034 introduce WithPrompt to configure compose backend to use a plugable UI component for user interaction
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-10-22 16:14:55 +02:00
Nicolas De Loof
e25265dd55 remove unused code to only rely on api.Service
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-10-20 14:53:04 +02:00
Guillaume Lours
be8c7e6c60 make CTRL+Z a no-op operation on Windows
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2025-10-17 15:07:37 +02:00
Nicolas De Loof
88aae9c46e support Ctrl+Z to run compose in background
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-10-15 17:26:11 +02:00
Kian Eliasi
ce463d50b2 Fix: set PWD only if not set
Signed-off-by: Kian Eliasi <kian.elbo@gmail.com>
2025-10-08 10:12:02 +02:00
Nicolas De Loof
07602f2070 publish Compose application as compose.yaml + images
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-10-03 10:59:57 +02:00