Commit Graph

4582 Commits

Author SHA1 Message Date
dependabot[bot] 191c10b9d0
build(deps): bump github.com/docker/cli from 25.0.0-rc.1+incompatible to 25.0.0-rc.2+incompatible (#11348)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-16 15:12:35 -05:00
Guillaume Lours 8b16ab1040
Merge pull request #11307 from glours/compose-go-immutable-projects
update compose-go to version using immutable Project functions
2024-01-11 14:11:12 +01:00
Guillaume Lours 24d34040e3
Merge pull request #11181 from g0t4/11153-compose-attach-override-container-attach-cmd
Implement `docker compose attach`
2024-01-11 11:11:10 +01:00
Guillaume Lours dbe7819fd4
Merge pull request #11333 from milas/hack-user-agent
feat(cli): report more useful User-Agent on engine API requests
2024-01-11 10:57:14 +01:00
Guillaume Lours 5d05df6e5c update compose-go to version using immutable Project functions
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-01-11 10:44:42 +01:00
Milas Bowman b621948c1b feat(cli): report more useful User-Agent on engine API requests
When using the Moby/Docker Engine API client, we do not have a
useful user agent value being reported. Ideally, in the future,
the Docker CLI will set this appropriately for plugins when it
initializes the client.

For now, manually set it, which is a bit hacky because it
requires some casting & manually invoking an option function
that's technically meant for initialization. In practice, this
is pretty safe - the cast is checked defensively and we ignore
any errors (which shouldn't be possible anyway).

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2024-01-10 13:38:27 -05:00
Guillaume Lours 6f62bcccbb
Merge pull request #11332 from milas/bump-golangci-lint
ci(deps): bump golangci-lint to v1.55.2
2024-01-10 19:30:00 +01:00
Milas Bowman f5c53c2d07 ci(deps): bump golangci-lint to v1.55.2
No new violations / changes needed.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2024-01-10 12:56:48 -05:00
Guillaume Lours 1cfeda71eb
ci(deps): bump golang to version v1.21.6 (#11331)
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-01-10 12:18:43 -05:00
Guillaume Lours e9c7a3a9d5
Merge pull request #11324 from docker/dependabot/go_modules/golang.org/x/sys-0.16.0
build(deps): bump golang.org/x/sys from 0.15.0 to 0.16.0
2024-01-10 15:50:30 +01:00
Brian Goff 2bf2b22fbe Add source policies for build
Build{x,kit} support passing in source policies via an (expirimental)
env var.
This change adds those policies to the build request.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2024-01-10 11:41:03 +01:00
Guillaume Lours 8d81b87513
Merge pull request #11330 from ndeloof/watch_tar
watch: remove requirements for tar binary and for sync target to be rw
2024-01-09 16:58:38 +01:00
Nicolas De Loof 575f2ed7f2
watch: remove requirements for tar binary and for sync target to be rw
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-01-09 15:43:34 +01:00
Wes Higbee 5f4b22ed7c make docs
Signed-off-by: Wes Higbee <wes.mcclure@gmail.com>
2024-01-08 17:21:26 -06:00
Wes Higbee dcf6bd779f make mocks
Signed-off-by: Wes Higbee <wes.mcclure@gmail.com>
2024-01-08 17:15:11 -06:00
Wes Higbee 80823b77ef go ahead and wire up sig-proxy and no-stdin for consistency with underlying docker container attach
Signed-off-by: Wes Higbee <wes.mcclure@gmail.com>
2024-01-08 17:15:11 -06:00
Wes Higbee 2c16e16db7 docker compose attach via RunAttach (from docker/cli's docker container attach)
Signed-off-by: Wes Higbee <wes.mcclure@gmail.com>
2024-01-08 17:14:49 -06:00
dependabot[bot] d1be9caf59
build(deps): bump golang.org/x/sys from 0.15.0 to 0.16.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.15.0 to 0.16.0.
- [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.16.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-01-08 09:34:40 +00:00
Guillaume Lours f659918743
Merge pull request #11298 from ndeloof/proxy
remove ServiceProxy which was introduced for archived compose-cli
2024-01-08 10:04:00 +01:00
dependabot[bot] c3c0cf3d94
build(deps): bump golang.org/x/sync from 0.5.0 to 0.6.0 (#11317)
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.5.0 to 0.6.0.
- [Commits](https://github.com/golang/sync/compare/v0.5.0...v0.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-05 13:43:38 -05:00
Milas Bowman eec822de8f
Merge pull request #11321 from thaJeztah/gha_bump_cli_version
gha: update DOCKER_CLI_VERSION to v24.0.7
2024-01-05 13:42:29 -05:00
Milas Bowman 6df3886b44
Merge pull request #11320 from thaJeztah/bump_engine3
go.mod: update docker/docker and docker/cli to v25.0.0-rc.1
2024-01-05 13:41:33 -05:00
Sebastiaan van Stijn 279874158c
gha: update DOCKER_CLI_VERSION to v24.0.7
I noticed that the CLI was still on 20.10, but the daemon on 24.0.7;

    Docker info
    /usr/bin/docker version
    Client:
    Version:           20.10.17
    API version:       1.41
    Go version:        go1.17.11
    Git commit:        100c701
    Built:             Mon Jun  6 22:56:42 2022
    OS/Arch:           linux/amd64
    Context:           default
    Experimental:      true
    Server: Docker Engine - Community
    Engine:
    Version:          24.0.7
    API version:      1.43 (minimum version 1.12)
    Go version:       go1.20.10
    Git commit:       311b9ff
    Built:            Thu Oct 26 09:07:41 2023
    OS/Arch:          linux/amd64
    Experimental:     false
    containerd:
    Version:          1.6.26
    GitCommit:        3dd1e886e55dd695541fdcd67420c2888645a495
    runc:
    Version:          1.1.10
    GitCommit:        v1.1.10-0-g18a0cb0
    docker-init:
    Version:          0.19.0
    GitCommit:        de40ad0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-05 19:32:23 +01:00
Sebastiaan van Stijn 566d2207f3
go.mod: github.com/docker/cli v25.0.0-rc.1
full diff: https://github.com/docker/cli/compare/v25.0.0-beta.3...v25.0.0-rc.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-05 18:57:57 +01:00
Sebastiaan van Stijn d09c39dced
go.mod: github.com/docker/docker v25.0.0-rc.1
full diff: https://github.com/docker/docker/compare/v25.0.0-beta.3...v25.0.0-rc.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-05 18:57:15 +01:00
Sebastiaan van Stijn a1d36379a3
go.mod: github.com/klauspost/compress v1.17.4
full diff: https://github.com/klauspost/compress/compare/v1.17.2...v1.17.4

v1.17.4:

- huff0: Speed up symbol counting
- huff0: Remove byteReader
- gzhttp: Allow overriding decompression on transport
- gzhttp: Clamp compression level
- gzip: Error out if reserved bits are set

v1.17.3:

- fse: Fix max header size
- zstd: Improve better/best compression
- gzhttp: Fix missing content type on Close

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-05 18:45:31 +01:00
Sebastiaan van Stijn 0c55998b41
go.mod: github.com/felixge/httpsnoop v1.0.4
full diff: https://github.com/felixge/httpsnoop/compare/v1.0.3...v1.0.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-05 18:39:58 +01:00
Sebastiaan van Stijn 2f6ec9b777
go.mod: github.com/docker/go-connections v0.5.0
no diff, as the tag is the same commit as we used already;
https://github.com/docker/go-connections/compare/fa09c952e3ea...v0.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-05 18:33:26 +01:00
Milas Bowman 06af729dc8
Merge pull request #11292 from laurazard/update-cli-signal-handling
Up: teardown when command context is cancelled
2024-01-02 15:48:14 -05:00
Laura Brehm dcbf005fe4
up: gracefully teardown when command ctx cancelled
Previously, if a long-lived plugin process (such as
an execution of `compose up`) was running and then
detached from a terminal, signalling the parent CLI
process to exit would leave the plugin process behind.

To address this, changes were introduced on the CLI side
(see: https://github.com/docker/cli/pull/4599) to enable
the CLI to notify a running plugin process that it should
exit. This makes it so that, when the parent CLI process
is going to exit, the command context of the plugin
command being executed is cancelled.

This commit takes advantage of these changes by tapping into
the command context's done channel and using it to teardown
on an up.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-12-23 02:49:27 +00:00
Nicolas De Loof e105f16527 introduce `stats` command
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-22 16:03:02 +01:00
Laura Brehm ce5a0c656f
Fix cancellable context detection in `AdaptCmd`
`AdaptCmd` was previously checking for a `.WithCancel` suffix
on context strings, however it's possible for a context to be
cancellable without ending in that suffix, such as when
`context.WithValue` was called after `WithContext`, e.g.:

```go
context.Background.WithCancel.WithValue(type trace.traceContextKeyType,
val <not Stringer>).WithValue(type api.DryRunKey, val <not Stringer>)
```

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-12-22 13:39:04 +00:00
Nicolas De Loof f58f23a6a2
remove ServiceProxy which was introduced for archived compose-cli
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-22 14:02:21 +01:00
Guillaume Lours d82a1a5a03
Merge pull request #11294 from thaJeztah/bump_engine2
go.mod: docker/docker and docker/cli v25.0.0-beta.3
2023-12-22 11:28:37 +01:00
Sebastiaan van Stijn 9aa5232601 go.mod: docker/docker and docker/cli v25.0.0-beta.3
- https://github.com/docker/cli/compare/70216b662dc4...v25.0.0-beta.3
- https://github.com/docker/docker/compare/v25.0.0-beta.2...v25.0.0-beta.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-12-22 11:18:43 +01:00
Sebastiaan van Stijn ccd83b8a74 go.mod: github.com/gorilla/mux v1.8.1
full diff: https://github.com/gorilla/mux/compoare/v1.8.0...v1.8.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-12-22 11:18:43 +01:00
Sebastiaan van Stijn 9e57850c16 go.mod: github.com/docker/distribution v2.8.3
full diff: https://github.com/docker/distribution/compare/v2.8.2...v2.8.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-12-22 11:18:43 +01:00
Sebastiaan van Stijn 35d3a7ca56 go.mod: golang.org/x/crypto v0.17.0
update the package, which contains a fix in the ssh package.

full diff: https://github.com/golang/crypto/compare/v0.16.0...v0.17.0

from the security mailing:

> Hello gophers,
>
> Version v0.17.0 of golang.org/x/crypto fixes a protocol weakness in the
> golang.org/x/crypto/ssh package that allowed a MITM attacker to compromise
> the integrity of the secure channel before it was established, allowing
> them to prevent transmission of a number of messages immediately after
> the secure channel was established without either side being aware.
>
> The impact of this attack is relatively limited, as it does not compromise
> confidentiality of the channel. Notably this attack would allow an attacker
> to prevent the transmission of the SSH2_MSG_EXT_INFO message, disabling a
> handful of newer security features.
>
> This protocol weakness was also fixed in OpenSSH 9.6.
>
> Thanks to Fabian Bäumer, Marcus Brinkmann, and Jörg Schwenk from Ruhr
> University Bochum for reporting this issue.
>
> This is CVE-2023-48795 and Go issue https://go.dev/issue/64784.
>
> Cheers,
> Roland on behalf of the Go team

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-12-22 11:18:43 +01:00
Sebastiaan van Stijn 6c998602bb go.mod: golang.org/x/crypto v0.16.0
full diff: https://github.com/golang/crypto/compare/v0.14.0...v0.16.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-12-22 11:18:43 +01:00
Sebastiaan van Stijn 402f368830 go.mod: golang.org/x/text v0.14.0
full diff: https://github.com/golang/text/compare/v0.13.0...v0.14.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-12-22 11:18:43 +01:00
Sebastiaan van Stijn 30dd3e66d7 go.mod: golang.org/x/term v0.15.0
full diff: https://github.com/golang/term/compare/v0.13.0...v0.15.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-12-22 11:18:43 +01:00
Nicolas De Loof 0c4fa017b9 Bump compose-go v2-beta.2
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-22 11:16:13 +01:00
dependabot[bot] b12e23b0bd build(deps): bump go.uber.org/mock from 0.3.0 to 0.4.0
Bumps [go.uber.org/mock](https://github.com/uber/mock) from 0.3.0 to 0.4.0.
- [Release notes](https://github.com/uber/mock/releases)
- [Changelog](https://github.com/uber-go/mock/blob/main/CHANGELOG.md)
- [Commits](https://github.com/uber/mock/compare/v0.3.0...v0.4.0)

---
updated-dependencies:
- dependency-name: go.uber.org/mock
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-21 14:52:59 +01:00
Nicolas De Loof 17da54da20 introduce build --with-dependencies
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-20 15:58:54 +01:00
horus 1baa4f4489 up: fix write/close race condition in logPrinter
The code used an atomic bool to guard channel writes. However, this
failed to synchronize with the call to close(), causing a panic.

Fix the race condition by using a mutex to guard the update to the
bool `stopped` and subsequent channel writes. This ensures atomic
execution of both updates to `stopped` and channel writes, preventing
races between writes and close().

Signed-off-by: horus <horus.li@gmail.com>
2023-12-20 15:45:12 +01:00
Guillaume Lours aefc2a111a
Merge pull request #11283 from laurazard/update-cli-version-go
deps: update docker/cli to fix go version selection issue
2023-12-19 15:26:24 +01:00
Laura Brehm 7781b7c992
deps: update docker/cli to fix go version selection issue
see: 70216b662d

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-12-19 14:15:16 +00:00
Albin Kerouanton 785835b1a2 Add support for endpoint-specific MAC address
Related to:

- https://github.com/compose-spec/compose-spec/pull/435
- https://github.com/moby/moby/pull/45905

Since API v1.44, Moby supports a per-endpoint MAC address and returns a
warning when the container-wide mac_address field is set.

A corresponding field has been added to compose-spec and compose-go, so
we need to leverage it to set the right API field.

This commit is backward-compatible with compose files that still set the
container-wide mac_address field, and older API versions that don't know
about the endpoint-specific MAC address field.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2023-12-18 12:04:45 +01:00
Nicolas De Loof e4fb5545f0 build do not require environment to be reslved
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-14 11:21:46 +01:00
Nicolas De Loof 74cc091225 github.com/golang/mock is deprecated
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-13 14:47:39 +01:00