Commit Graph

951 Commits

Author SHA1 Message Date
Nicolas De Loof 82b41b9ebd introduce service hooks
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-10-07 16:06:41 +02:00
Nicolas De Loof 6c06170eb0 pass device.options to engine
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-10-04 14:55:53 +02:00
MohammadHasan Akbari 60c1311f67 chore: remove errors depricated pkg
Signed-off-by: MohammadHasan Akbari <116190942+jarqvi@users.noreply.github.com>
Signed-off-by: MohammadHasan Akbari <jarqvi.jarqvi@gmail.com>
2024-10-02 21:15:59 +02:00
MohammadHasan Akbari bf0418bac1 fix: lint
Signed-off-by: MohammadHasan Akbari <116190942+jarqvi@users.noreply.github.com>
Signed-off-by: MohammadHasan Akbari <jarqvi.jarqvi@gmail.com>
2024-10-02 21:15:59 +02:00
MohammadHasan Akbari b9d0c77cde feat: add export command
Signed-off-by: MohammadHasan Akbari <jarqvi.jarqvi@gmail.com>
2024-10-02 21:15:59 +02:00
Ananta Dwi Prasetya Purna Yuda bdb8545611 fix(convergence): Serialize access to observed state
Signed-off-by: Ananta Dwi Prasetya Purna Yuda <hi@anantadwi13.com>
2024-10-02 15:04:38 +02:00
Joana Hrotko 41df35c1f4 Remove bind options when creating a volume type
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
2024-10-02 10:00:28 +02:00
Suleiman Dibirov 87f457e7dc add tests to down.go
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
2024-09-26 10:36:37 +02:00
Suleiman Dibirov abcc91e2b9 fix(down): Fix down command if specified services are not running
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
2024-09-26 10:36:37 +02:00
Joana Hrotko 8b9fe89842 After container restart register printer consumer
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
2024-09-24 14:01:51 +02:00
Nicolas De Loof 34b18194f7 check secret source exists, as bind mount would create target as a folder otherwise
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-09-23 19:36:41 +02:00
Nicolas De Loof ce27dba52e wait for dependent service up to delay set by --wait-timeout
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-09-23 18:25:02 +01:00
Nicolas De Loof d2b9456137 append unix-style relative path when computing container target path
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-09-20 17:00:23 +02:00
Guillaume Lours 9c60fe67df revert commits link to mount API over bind changes
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-09-20 10:37:57 +02:00
Nicolas De Loof c16df17e1f don't set propagation if target engine isn't linux
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-09-18 17:54:19 +02:00
Nicolas De Loof cb00aaad28 set propagation default
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-09-17 10:50:16 +02:00
Suleiman Dibirov 73d3a25ebd fix import
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
2024-09-16 11:21:43 +02:00
Suleiman Dibirov 3524bcfad0 chore(watch): Add debug log when skipping service without build context
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
2024-09-16 11:21:43 +02:00
Nicolas De Loof 1076f1d9a5 stop dependent containers before recreating diverged service
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-09-16 10:14:54 +02:00
Suleiman Dibirov 8bf0627ea9 show sync files only in debug level
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
2024-09-12 14:38:02 +02:00
Suleiman Dibirov 2e14191682 chore(watch): Add changed files path/count to log
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
2024-09-12 14:38:02 +02:00
Guillaume Lours 8db0cba0af bump compose-go to version v2.2.0
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-09-12 09:36:18 +02:00
Sebastiaan van Stijn d445ebba3f fix linting issues with golangci-lint 1.60.2
pkg/watch/watcher_darwin.go:96:16: Error return value of `d.stream.Start` is not checked (errcheck)
        d.stream.Start()
                      ^
    pkg/prompt/prompt.go:97:12: Error return value of `fmt.Fprint` is not checked (errcheck)
        fmt.Fprint(u.stdout, message)
                  ^
    pkg/prompt/prompt.go:99:12: Error return value of `fmt.Scanln` is not checked (errcheck)
        fmt.Scanln(&answer)
                  ^
    cmd/formatter/logs.go:118:15: Error return value of `fmt.Fprintf` is not checked (errcheck)
                fmt.Fprintf(w, "%s%s%s\n", p.prefix, timestamp, line)
                           ^
    cmd/formatter/logs.go:120:15: Error return value of `fmt.Fprintf` is not checked (errcheck)
                fmt.Fprintf(w, "%s%s\n", p.prefix, line)
                           ^
    pkg/progress/json.go:67:15: Error return value of `fmt.Fprintln` is not checked (errcheck)
            fmt.Fprintln(p.out, string(marshal))
                        ^
    pkg/progress/json.go:87:15: Error return value of `fmt.Fprintln` is not checked (errcheck)
            fmt.Fprintln(p.out, string(marshal))
                        ^
    pkg/progress/plain.go:47:14: Error return value of `fmt.Fprintln` is not checked (errcheck)
        fmt.Fprintln(p.out, prefix, e.ID, e.Text, e.StatusText)
                    ^
    pkg/progress/tty.go:162:12: Error return value of `fmt.Fprint` is not checked (errcheck)
        fmt.Fprint(w.out, b.Column(0).ANSI)
                  ^
    pkg/progress/tty.go:165:12: Error return value of `fmt.Fprint` is not checked (errcheck)
        fmt.Fprint(w.out, aec.Hide)
                  ^
    pkg/compose/attach.go:53:13: Error return value of `fmt.Fprintf` is not checked (errcheck)
        fmt.Fprintf(s.stdout(), "Attaching to %s\n", strings.Join(names, ", "))
                   ^
    pkg/compose/compose.go:194:6: emptyStringTest: replace `len(dependencies) > 0` with `dependencies != ""` (gocritic)
            if len(dependencies) > 0 {
               ^
    pkg/compose/convergence.go:461:2: builtinShadow: shadowing of predeclared identifier: max (gocritic)
        max := 0
        ^
    pkg/compose/run.go:127:5: emptyStringTest: replace `len(opts.User) > 0` with `opts.User != ""` (gocritic)
        if len(opts.User) > 0 {
           ^
    pkg/compose/run.go:139:5: emptyStringTest: replace `len(opts.WorkingDir) > 0` with `opts.WorkingDir != ""` (gocritic)
        if len(opts.WorkingDir) > 0 {
           ^
    pkg/compose/viz.go:91:8: emptyStringTest: replace `len(portConfig.HostIP) > 0` with `portConfig.HostIP != ""` (gocritic)
                    if len(portConfig.HostIP) > 0 {
                       ^
    cmd/compatibility/convert.go:66:6: emptyStringTest: replace `len(arg) > 0` with `arg != ""` (gocritic)
            if len(arg) > 0 && arg[0] != '-' {
               ^
    pkg/e2e/watch_test.go:208:25: printf: non-constant format string in call to gotest.tools/v3/poll.Continue (govet)
                return poll.Continue(res.Combined())
                                     ^
    pkg/e2e/watch_test.go:290:25: printf: non-constant format string in call to gotest.tools/v3/poll.Continue (govet)
                return poll.Continue(r.Combined())
                                     ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-11 13:56:25 +02:00
Nathan Baulch 524a97e553 Fix typos
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
2024-09-11 11:21:24 +02:00
Felix Fontein 1d608e0338 Use logrus instead of direct output to stderr.
Signed-off-by: Felix Fontein <felix@fontein.de>
2024-09-11 09:38:05 +02:00
Laura Brehm 329ad73922 attach: close streams when done
When Compose is watching a project/reattaching streams on container
start, it will make new API `ContainerAttach()` calls every time a
container it's watching is started. However, it only closes the stream
when the context used to start the attach is canceled.

This means that if a user has a project with multiple containers where
containers keep restarting, Compose will attach to the new containers
but never close the previous streams, causing fds to pile up and
goroutines on the engine to get stuck.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-09-10 14:55:48 +02:00
jonathan-dev b633c5c3e1 Fix typo in pull.go
Signed-off-by: jonathan-dev <jonathan.drude@gmail.com>
2024-09-10 09:03:12 +02:00
Remco Kranenburg e6ef8629a8 Allow combination of bind mounts and 'rebuild' watches
Signed-off-by: Remco Kranenburg <remco.kranenburg@crunchr.com>
2024-09-04 07:41:37 +02:00
Nicolas De Loof d658fecc63 service hash must exlude depends_on
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-08-26 16:05:15 +01:00
Nicolas De Loof f9c7a0cc08 prefer mount API over bind
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-08-26 16:05:04 +01:00
Joana Hrotko 9c03797f9d initial sync files that modified after image creation
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
2024-08-09 12:11:16 +02:00
Joana Hrotko 485c0eba53 initial sync for root directory
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
2024-08-09 12:11:16 +02:00
Joana Hrotko ea4ccf639d Fix stop on file chane for sync-restart action
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
2024-07-25 16:28:47 +02:00
Cody Rigney 44337d2bbf Enhance JSON progress events with more fields.
Signed-off-by: Cody Rigney <cody.rigney@docker.com>
2024-07-23 16:20:27 +02:00
Suleiman Dibirov 4f9db4d3e6 fix(containers): fix sorting logic by adding secondary sorting for one-off containers
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
2024-07-22 09:32:59 +02:00
Guillaume Lours 46679150d6 bump compose-go to v2.1.4, buildx to v0.16.0, containerd to v1.7.19 and buildx to v0.15.0
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-07-17 13:01:51 +02:00
Nicolas De Loof d3d378b92a restore setEnvWithDotEnv
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-07-11 10:25:04 +02:00
Nicolas De Loof 163cdfd31d empty env variable with no value must be unset in container
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-07-10 14:23:34 +02:00
Nicolas De Loof 25f85938bb exclude unnecessary resources after services have been selected
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-07-09 15:12:27 +02:00
Suleiman Dibirov 9549a213ba feat(watch): Add --prune option to docker-compose watch command
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
2024-07-02 08:16:09 +02:00
Joana Hrotko da434013e3 Remove COMPOSE_MENU env from e2e tests
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
2024-07-01 16:31:12 +01:00
Felix Fontein 06545d0668 Add JSON stream progress writer
Signed-off-by: Felix Fontein <felix@fontein.de>
2024-07-01 15:32:51 +02:00
Paweł Gronowski f79c28168b Remove `console.Terminal` check and use `IsTerminal` from `streams.Out`
docker/cli v27 changed the return value of `Err()` to `streams.Out`
which made the typecheck for `console.File` fail.

The check is no longer needed due to the `IsTerminal` method present in
`streams.Out` which also has a special handling for Windows console.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-06-24 14:58:19 +02:00
Albin Kerouanton 6a000dcff1 go.mod: github.com/compose-spec/compose-go v2.1.3
full diff:

- https://github.com/compose-spec/compose-go/compare/v2.1.2...v2.1.3

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-21 14:04:40 +02:00
Albin Kerouanton 2636dcf064 go.mod: docker/docker and docker/cli v27.0.1-rc.1
diffs:

- https://github.com/docker/cli/compare/v26.1.4..v27.0.1-rc.1
- https://github.com/docker/docker/compare/v26.1.4..v27.0.1-rc.1

Co-authored-by: Albin Kerouanton <albinker@gmail.com
Signed-off-by: Albin Kerouanton <albinker@gmail.com
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-21 14:04:40 +02:00
Guillaume Lours e1fd7a6567 using as flag of the up command, watch was blocking process shutdown
This happened when sunsetting the application from docker compose down command

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-06-20 10:50:01 +02:00
Guillaume Lours 54a5e7d4aa stop watch process when associated up process is stopped
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-06-17 22:59:09 +02:00
Sebastiaan van Stijn 5ec37d08a5 build: replace uses of archive.CanonicalTarNameForPath
This function is an alias for filepath.IsAbs and we are considering deprecating
and/or removing this function in the archive package, so removing its uses
helps transitioning if we decide to deprecate and/or remove it.

[docker/cli@fb0788f] also added a normalize step in TrimBuildFilesFromExcludes,
so that callers are not _required_ to first normalize the path, so the
normalizeation may be redunant, but keeping the normalization as this variable
is used further down the code.

[docker/cli@fb0788f]: fb0788f18f

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-17 12:00:24 +02:00
Nicolas De Loof 084a5ca312 enforce keyboard.Close is always executed to restore terminal
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-06-11 07:20:37 +02:00
Alex Bedo cc09f39f29 Readd event
Signed-off-by: Alex Bedo <alex98hun@gmail.com>
2024-06-10 12:06:30 +02:00