Commit Graph
610 Commits
Author SHA1 Message Date
Samarth Verma 0d8dc09048 cmd/display: left-pad timers for right-aligned column
Signed-off-by: Samarth Verma <[email protected]>
2026-03-20 15:14:05 +01:00
Samarth Verma 02aaf253c8 Fix TTY timer alignment leaving stale suffix
Signed-off-by: Samarth Verma <[email protected]>
2026-03-20 15:14:05 +01:00
maks2134 c7e8896360 Fix forbidigo linting error
- Replace context.Background() with t.Context() in TestDoneDeadlockFix
- Ensures .idea files are not included in commit

Signed-off-by: maks2134 <[email protected]>
2026-03-18 16:23:34 +01:00
maks2134 e3fcdb8238 Fix linting issues in tty_test.go
- Replace context.Background() with context.WithCancel() in test
- Fix formatting issues (remove extra empty line)

Signed-off-by: maks2134 <[email protected]>
2026-03-18 16:23:34 +01:00
maks2134 25b29d776b Fix deadlock in ttyWriter.Done()
Resolves race condition between main thread calling Done() and UI thread
calling printWithDimensions(). The issue was that Done() held the mutex
while sending to the done channel, but the UI thread needed the same
mutex to process the done signal.

Fixed by sending the done signal before acquiring the mutex, allowing
the UI thread to receive the signal and release any held locks.

Fixes #13639

Signed-off-by: maks2134 <[email protected]>
2026-03-18 16:23:34 +01:00
Max Proske 85d6770b7f Fix panic when watch rebuilds without up
Signed-off-by: Max Proske <[email protected]>
2026-02-24 17:21:59 +01:00
Sebastiaan van Stijn f9828dfab9 modernize some code
Results of running the modernize command, with some minor changes
afterwards (removing the `contains` and `hasStatus` helper functions);

    go install golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest
    modernize -fix ./...

Signed-off-by: Sebastiaan van Stijn <[email protected]>
2026-02-12 15:31:35 +01:00
Sebastiaan van Stijn bfb5511d0d go.mod: bump github.com/moby/moby/api v1.53.0, moby/client v0.2.2
Also update TestDefaultNetworkSettings:
Test that the network with the highest priority is returned as
"primary" network, and other networks as extra networks.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
2026-02-11 12:32:37 +01:00
Michael IrwinandClaude Sonnet 4.5 7f8814f4c5 Fix invalid path error when using OCI artifacts on Windows
When using OCI artifacts (e.g., `docker compose -f oci://dockersamples/welcome-to-docker up`)
on Windows, users encountered the following error:

  CreateFile C:\Users\username\oci:\dockersamples\.env: The filename, directory name,
  or volume label syntax is incorrect.

This issue was introduced between v5.0.0 and v5.0.1, specifically by commit 6c043929a
which fixed error handling in setEnvWithDotEnv. The bug existed in v5.0.0 but was
silently ignored due to improper error handling.

Root Cause:
-----------
The setEnvWithDotEnv function creates ProjectOptions without registering remote loaders.
Without remote loaders, the compose-go library doesn't recognize OCI paths as remote
resources. It falls through to filepath.Abs() which treats the OCI reference as a
relative path.

On Windows, filepath.Abs("oci://dockersamples/...") produces an invalid path like:
  C:\Users\username\oci:\dockersamples

Windows rejects this path because colons are only valid after drive letters.

Solution:
---------
Modified setEnvWithDotEnv to detect remote config paths and skip environment loading
for them. Instead of hardcoding string checks, the fix uses the actual remote loaders'
Accept() method to determine if a config path is remote. This is more maintainable
and consistent with how the compose-go library identifies remote resources.

The function now:
- Accepts a dockerCli parameter to access remote loaders
- Uses opts.remoteLoaders(dockerCli) to get loader instances
- Checks if any loader accepts the config path using loader.Accept()
- Skips .env loading for remote configs (happens later when loaders are initialized)
- Allows normal processing for local compose files

Testing:
--------
- Added tests for OCI artifacts, Git remotes, and local paths
- Verified fix works on Windows ARM64
- All existing tests pass

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Signed-off-by: Michael Irwin <[email protected]>
2026-02-09 09:15:37 +01:00
Sebastiaan van Stijn c51b1fea29 replace some uses of strings.Split(N) for strings.Cut
Signed-off-by: Sebastiaan van Stijn <[email protected]>
2026-01-22 11:26:16 +01:00
Mahesh Thakur a061c17736 fix: emit container status events after network reconnection
Signed-off-by: Mahesh Thakur <[email protected]>
2026-01-21 09:40:05 +01:00
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
2026-01-19 11:14:23 +01:00
tensorworker 02b606ef8e use go-compose instead Signed-off-by: tensorworker <[email protected]>
Signed-off-by: tensorworker <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
2026-01-05 09:31:14 +01:00
hiroto.toyoda 327be1fcd5 add unit test
Signed-off-by: hiroto.toyoda <[email protected]>
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 <[email protected]>
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 <[email protected]>
2025-12-15 16:36:57 +01:00
hiroto.toyoda 55cded1806 Avoid reassigning err variable
Signed-off-by: hiroto.toyoda <[email protected]>
2025-12-15 15:18:54 +01:00
hiroto.toyoda 6c043929a0 Fix missing error handling in setEnvWithDotEnv
Signed-off-by: hiroto.toyoda <[email protected]>
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 <[email protected]>
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 <[email protected]>
2025-12-12 14:22:02 +01:00
Nicolas De Loof b62cbed87c Fixed status alignment in progress UI.
Signed-off-by: Nicolas De Loof <[email protected]>
2025-12-11 15:25:03 +01:00
Nicolas De Loof aa9a71f37a run finalization synchronously
Signed-off-by: Nicolas De Loof <[email protected]>
2025-12-10 22:49:37 +01:00
Nicolas De Loof d12947e9f8 Fixed broken run --quiet.
Signed-off-by: Nicolas De Loof <[email protected]>
2025-12-08 13:34:26 +01:00
xiaolinny 0878c59a74 chore: fix grammatical errors and improve clarity in code
Signed-off-by: xiaolinny <[email protected]>
2025-12-08 11:20:48 +01:00
Nicolas De Loof c0345e4f45 restore support for COMPOSE_COMPATIBILITY
Signed-off-by: Nicolas De Loof <[email protected]>
2025-12-07 18:42:04 +01:00
zjumathcode 13d70b1c11 refactor: replace interface{} with any for clarity and modernization
Signed-off-by: zjumathcode <[email protected]>
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 <[email protected]>
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 <[email protected]>
2025-12-01 12:21:50 +01:00
Nicolas De Loof b32297dccd add --wait option to start command
Signed-off-by: Nicolas De Loof <[email protected]>
2025-12-01 11:58:00 +01:00
vicerace 822f5a702b refactor: replace Split in loops with more efficient SplitSeq
Signed-off-by: vicerace <[email protected]>
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 <[email protected]>
2025-11-16 14:54:58 +01:00
Sebastiaan van Stijn 89d3944837 fix linting issues
Signed-off-by: Sebastiaan van Stijn <[email protected]>
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 <[email protected]>
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 <[email protected]>
2025-11-13 09:32:43 +01:00
Nicolas De Loof 6e55832b1c add (restore) support for detach keys
Signed-off-by: Nicolas De Loof <[email protected]>
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 <[email protected]>
2025-11-12 11:17:28 +01:00
Nicolas De Loof aff5c115d6 move progress UI components into cmd
Signed-off-by: Nicolas De Loof <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
2025-11-03 08:58:30 +01:00
Guillaume Lours 3658a063bb add AlwaysOkPrompt to replace 'AlwaysYes' current implementation'
Signed-off-by: Guillaume Lours <[email protected]>
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 <[email protected]>
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 <[email protected]>
2025-10-29 10:11:30 +01:00