Commit Graph

4837 Commits

Author SHA1 Message Date
Nicolas De Loof a7424435b3 Restore compose v1 behavior to recreate containers when ran with -V
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-09-11 15:16:28 +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
Guillaume Lours f592aad10d bump golang to version 1.22.7
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-09-11 13:56:25 +02:00
Guillaume Lours ef46445ed3 bump dependencies versions, engine and cli v27.2.1
containerd v1.7.22
buildx v0.17.0
buildkit v0.16.0

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-09-11 13:56:25 +02:00
dependabot[bot] 150593298e build(deps): bump golang.org/x/sys from 0.22.0 to 0.25.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.22.0 to 0.25.0.
- [Commits](https://github.com/golang/sys/compare/v0.22.0...v0.25.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-11 11:35:23 +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
David Karlsson 6e172d6b89 docs: duplicate documentation for root cmd
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-08-22 15:12:30 +02:00
Suleiman Dibirov 98e261ba32 docs(wait): Fix wait command description
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
2024-08-19 10:44:57 +02:00
Guillaume Lours 11c7a25ae9 allow to add empty line in the logs when nav menu activated
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-08-16 17:14:41 +02:00
Joana Hrotko 234036756b upgrade docker versions
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
2024-08-14 13:57:41 +02: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
Mayank Kapur 69384a9a0f Removes redundant condition from toAPIBuildOptions in build.go
Signed-off-by: Mayank Kapur <kapurm17@gmail.com>
2024-08-05 08:08:41 +02:00
Jan Brasna 1601ead7bc docs: Update docker compose kill usage
Signed-off-by: Jan Brasna <1784648+janbrasna@users.noreply.github.com>
2024-08-05 07:41:53 +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
Guillaume Lours b1850ea4d4 bump engine and cli to v27.1.1, buildx to v0.16.1
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-07-25 16:24:08 +02:00
Guillaume Lours adba639e88 remove all dependabot update PRs for OTel dependencies
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-07-25 16:23:54 +02:00
Sebastiaan van Stijn d8518529c4 gp.mod: github.com/gofrs/flock v0.12.1
- fix: missing read-write flag in reopenFDOnError
  fixes a regression that could result in a `ERROR: bad file descriptor`.

b659e1e00a
introduced a regression where `f.flag` would not be in read-write mode
[1]  but read-only [2] which breaks people using NFS protocol.

[1]: b659e1e00a (diff-87c2c4fe0fb43f4b38b4bee45c1b54cfb694c61e311f93b369caa44f6c1323ffR192)
[2]: b659e1e00a (diff-22145325dded38eb5288ed3321a113d8260ccc70747ee04d4551bfd2fba975fdR69)

full diff: https://github.com/gofrs/flock/compare/v0.12.0...v0.12.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-25 10:59:33 +02:00
Sebastiaan van Stijn c79f15da9e go.mod: golang.org/x/sys v0.22.0
full diff: https://github.com/golang/sys/compare/v0.21.0...v0.22.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-25 10:59:33 +02:00
Sebastiaan van Stijn 3f55382ff0 update to go1.21.12
go1.21.12 (released 2024-07-02) includes security fixes to the net/http package,
as well as bug fixes to the compiler, the go command, the runtime, and the
crypto/x509, net/http, net/netip, and os packages. See the Go 1.21.12 milestone
on our issue tracker for details:

- https://github.com/golang/go/issues?q=milestone%3AGo1.21.12+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.21.11...go1.21.12

From the security mailing:

> Hello gophers,
>
> We have just released Go versions 1.22.5 and 1.21.12, minor point releases.
>
> These minor releases include 1 security fixes following the security policy:
>
> * net/http: denial of service due to improper 100-continue handling
>
>   The net/http HTTP/1.1 client mishandled the case where a server responds
>   to a request with an “Expect: 100-continue” header with a non-informational
>   (200 or higher) status. This mishandling could leave a client connection
>   in an invalid state, where the next request sent on the connection will fail.
>
> An attacker sending a request to a net/http/httputil.ReverseProxy proxy can
> exploit this mishandling to cause a denial of service by sending
> “Expect: 100-continue” requests which elicit a non-informational response
> from the backend. Each such request leaves the proxy with an invalid connection,
> and causes one subsequent request using that connection to fail.
>
> Thanks to Geoff Franks for reporting this issue.
>
> This is CVE-2024-24791 and Go issue https://go.dev/issue/67555.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-25 10:43:39 +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
Nicolas De Loof bc733508d6 bump compose-go v2.1.5
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-07-23 16:01:16 +02:00
Sebastiaan van Stijn c422b5447c bump github.com/docker/cli v27.1.0
full diffs:

- https://github.com/docker/cli/compare/v27.0.3...v27.1.0
- https://github.com/grpc/grpc-go/compare/v1.59.0...v1.60.1
- https://github.com/open-telemetry/opentelemetry-go/compare/exporters/otlp/otlpmetric/otlpmetricgrpc/v0.42.0...exporters/otlp/otlpmetric/otlpmetricgrpc/v0.44.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-23 15:33:58 +02:00
Sebastiaan van Stijn e74441c907 bump github.com/docker/docker v27.1.0
full diff: https://github.com/docker/docker/compare/v27.0.3...v27.1.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-23 15:33:58 +02:00
Sebastiaan van Stijn 2bac32a46e bump github.com/containerd/containerd v1.7.20
full diffs:

= containerd: https://github.com/containerd/containerd/compare/v1.7.19...v1.7.20
- google.golang.org/genproto/googleapis/rpc 49dd2c1f3d...995d672761
- google.golang.org/genproto: 49dd2c1f3d...989df2bf70
- google.golang.org/genproto/googleapis/api: 49dd2c1f3d...83a465c022

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-23 15:33:58 +02:00
Sebastiaan van Stijn f278400fbc gha: add docker 27.1.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-23 15:21:34 +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
guoguangwu 06bf339a42 fix: typos
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
2024-07-17 13:48:13 +01:00
Guillaume Lours 231ea10058 update docs generation to avoid man pages generation
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-07-17 13:01:51 +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
Joana Hrotko cacbca859d change time for stale bot
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
2024-07-09 12:06:54 +02:00
Joana Hrotko ecac13f272 Remove debug mode and run twice a week
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
2024-07-08 15:26:37 +02:00
Joana Hrotko 14793cc2e4 Add stale workflow
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
2024-07-08 15:26:37 +02:00
Suleiman Dibirov 11d5ecdc75 update docs
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
2024-07-02 08:16:09 +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 ace69c96a7 Use rawjson for the build backend.
Signed-off-by: Felix Fontein <felix@fontein.de>
2024-07-01 15:32:51 +02:00
Felix Fontein 2db04c1e40 Set logging format to JSON.
Signed-off-by: Felix Fontein <felix@fontein.de>
2024-07-01 15:32:51 +02:00
Felix Fontein 8f7cd00481 Format errors as JSON when in JSON progress mode.
Signed-off-by: Felix Fontein <felix@fontein.de>
2024-07-01 15:32:51 +02:00
Felix Fontein 5a6e1a7e2e Pass 'plain' instead of 'json' to build backend
Signed-off-by: Felix Fontein <felix@fontein.de>
2024-07-01 15:32:51 +02: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