Commit Graph

5463 Commits

Author SHA1 Message Date
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
Guillaume Lours
da5c57c29d test digest or canonical reference, not only tag, when checking if an image is already present
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2025-10-20 18:42:24 +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
Nicolas De Loof
e19e1278b5 fail build if minimal required version of buildx isn't installed
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-10-20 12:25:38 +02:00
Nicolas De Loof
585c4db4f9 Compose can't create a tar with adequate uid:gid ownership
as we can't get container UID/GID as int by ContainerInspect
revert https://github.com/docker/compose/pull/13288

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-10-20 09:51:58 +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>
v2.40.1
2025-10-17 15:07:37 +02:00
Nicolas De Loof
27f59d7f42 Detect failure to access os.TempDir
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-10-17 09:49:44 +02:00
Nicolas De Loof
2681ed17a7 mutualize code from injectSecrets / injectConfigs
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-10-16 17:43:04 +02:00
Nicolas De Loof
ee75be342b Set secret/config uid:gid to match container's USER
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-10-16 17:43:04 +02:00
Paul Thiele
157617480a fix race-condition bug in publish command
Signed-off-by: Paul Thiele <paul.thiele@kinexon.com>
2025-10-16 09:24:57 +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
Guillaume Lours
7755302348 use fixed version of compose bridge transformer images
to avoid CI issue on Compose when a new version is released and change the outputs

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2025-10-14 09:21:59 +02:00
Guillaume Lours
147923c44c bump golang to version 1.24.9
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2025-10-14 09:14:56 +02:00
Olivier Goulpeau
289faae5fa fix(publish): in publish(), select all profiles in the project to publish.
This code is moved from `generateImageDigestsOverride()` as no more
needed at that point.

Signed-off-by: Olivier Goulpeau <olivier.goulpeau@ledger.fr>
2025-10-14 08:25:26 +02:00
Olivier Goulpeau
e7aa484b78 fix(publish): in processFile(), load the compose file passing the project.Profiles to the loader.Options.
Signed-off-by: Olivier Goulpeau <olivier.goulpeau@ledger.fr>
2025-10-14 08:25:26 +02:00
Sebastiaan van Stijn
ae3309afab pkg/compose: build with bake: drop support for buildx v0.16 and lower
[buildx v0.17][1] was released a Year ago, so any version this
conditional code was accounting for would be versions before that;
the latest of which being [buildx v0.16.2][2] (July 2024).

Given that those versions are long EOL and no longer supported, we
can probably remove the conditional code.

[1]: https://github.com/docker/buildx/releases/tag/v0.17.0
[2]: https://github.com/docker/buildx/releases/tag/v0.16.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-14 08:02:58 +02:00
Sebastiaan van Stijn
0b5fb36eb5 build(deps): bump docker/buildx v0.29.1, moby/buildkit v0.25.1
full diff:

- https://github.com/docker/buildx/compare/v0.28.0...v0.29.1
- https://github.com/moby/buildkit/compare/v0.24.0...v0.25.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-13 21:21:01 +02:00
Sebastiaan van Stijn
63920c4cc0 pkg/compose: align classic builder implementation with docker/cli
This aligns the implementation closer to the implementation in docker/cli,
with the refactor done in [cli@260f1db]; this removes some direct uses of
the github.com/docker/docker/builder/remotecontext/urlutil package, which
won't be included in the new Moby modules.

There's still some remaining uses in the `dockerFilePath` utility (which
may need to be updated to also account for remote contexts that are not
"git"), so possibly we can remove the use in that utility as well.

[cli@260f1db]: 260f1dbebb

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-13 16:53:00 +02:00
Nicolas De Loof
a03f2562df bake only interpolates ${*}
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-10-13 10:40:19 +02:00
dependabot[bot]
a07f2b8ded build(deps): bump golang.org/x/sys from 0.36.0 to 0.37.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.36.0 to 0.37.0.
- [Commits](https://github.com/golang/sys/compare/v0.36.0...v0.37.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-09 11:35:31 +02:00
dependabot[bot]
f45a3ebcfd build(deps): bump github.com/docker/cli
Bumps [github.com/docker/cli](https://github.com/docker/cli) from 28.5.0+incompatible to 28.5.1+incompatible.
- [Commits](https://github.com/docker/cli/compare/v28.5.0...v28.5.1)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-version: 28.5.1+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-09 11:35:14 +02:00
dependabot[bot]
7fec70b6c7 build(deps): bump github.com/docker/docker
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 28.5.0+incompatible to 28.5.1+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v28.5.0...v28.5.1)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-version: 28.5.1+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-09 11:34:52 +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
Benedikt Radtke
fa7e85ed83 Write error to watcher error channel if Start() fails
Up's loop will notice globalCtx is done, and invoke watcher.Stop(). Stop() reads from the watcher error channel. If Start() does not write an error, Stop() will never finish.

Fixes https://github.com/docker/compose/issues/13262

Signed-off-by: Benedikt Radtke <benediktradtke@gmail.com>
2025-10-06 14:50:19 +02:00
dependabot[bot]
d9423f6872 build(deps): bump github.com/docker/cli
Bumps [github.com/docker/cli](https://github.com/docker/cli) from 28.5.0-rc.1+incompatible to 28.5.0+incompatible.
- [Commits](https://github.com/docker/cli/compare/v28.5.0-rc.1...v28.5.0)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-version: 28.5.0+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
v2.40.0
2025-10-03 11:32:15 +02:00
dependabot[bot]
5add90240d build(deps): bump github.com/docker/docker
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 28.5.0-rc.1+incompatible to 28.5.0+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v28.5.0-rc.1...v28.5.0)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-version: 28.5.0+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-03 11:32:08 +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
Nicolas De Loof
cf7e31f731 escape $ in bake.json as interpolation already has been managed by compose
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-10-03 09:25:35 +02:00
Nicolas De Loof
fa08127456 use containerd client for OCI operations
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-09-30 12:03:46 +02:00
Nicolas De Loof
4ee52ad168 pass bake secrets by env
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-09-30 09:07:22 +02:00
Sebastiaan van Stijn
4a4776ec57 cmd/compose: fix minor linting issues
- inline variable that shadowed package-type
- don't use apiBuildOptions if an error was returned

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-29 15:25:22 +02:00
Sebastiaan van Stijn
713de5bb9e pkg/compose: explicitly map AuthConfig fields instead of a direct cast
Commit [cli@27b2797] forked the AuthConfig type from the API, and changed
existing code to do a direct cast / convert of the forked type to the API
type. This can cause issues if the API types diverges, such as the removal
of the Email field.

This patch explicitly maps each field to the corresponding API type, but
adds some TODOs, because various code-paths only included a subset of the
fields, which may be intentional for fields that were meant to be handled
on the daemon / registry-client only.

We should evaluate these conversions to make sure these fields should
be sent from the client or not (and possibly even removed from the API
type).

[cli@27b2797]: 27b2797f7d

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-29 15:24:42 +02:00
Sebastiaan van Stijn
9ded1684cd gha: update test-matrix: remove docker 26.x
- Mirantis Container Runtime (MCR) 23.0 reached EOL, and the next LTS
  version of MCR is 25.x, but download.docker.com does not have 25.x
  packages for the latest Ubuntu release.
- Docker 26.x reached EOL and is no longer maintained

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-29 14:27:41 +02:00
Guillaume Lours
8bc8593fd0 provider services: use '--project-name=' notation
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2025-09-29 12:38:10 +02:00
Nicolas De Loof
8978c1027d use containerd registry client
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-09-26 18:45:07 +02:00
Sebastiaan van Stijn
032e0309ee cmd: pluginMain: use WithUserAgent option
Rewrite the custom user agent to use the new options that were added
in the cli:

- plugin.Run now accepts custom CLI options to allow customizing the CLI's
- cli/command now has a WithUserAgent option to customize the CLI's user-
  agent, allowing it to be overridden from the default.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-25 16:50:44 +02:00
Sebastiaan van Stijn
38ba35e165 pkg/mocks: re-generate mocks
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-25 16:50:44 +02:00
Sebastiaan van Stijn
56e0ba8080 build(deps): bump github.com/docker/docker, docker/cli v28.5.0-rc.1
full diff:

- https://github.com/docker/cli/compare/v28.4.0...v28.5.0-rc.1
- https://github.com/docker/docker/compare/v28.4.0...v28.5.0-rc.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-25 16:50:44 +02:00
Sebastiaan van Stijn
9752fa5500 pluginMain: remove uses of DockerCLI.Apply
The Apply method was added when CLI options for constructing the CLI were
rewritten into functional options in [cli@7f207f3]. There was no mention
in the pull request of this method specifically, and we want to remove or
reduce functions that mutate the CLI configuration after initialization
if possible (and likely remove the `Apply` method).

This patch removes the use of the `Apply` function as an intermediate step;
improvements will be made in the CLI itself for a more solid implementation.

[cli@7f207f3]: 7f207f3f95

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-24 14:09:55 +02:00
Sebastiaan van Stijn
4761fd88b0 pkg/compose: build: remove permissions warning on Windows
This warning was added in [moby@4a8b3ca] to print a warning when building
Linux images from a Windows client. Window's filesystem does not have an
"executable" bit, which mean that, for example, copying a shell script
to an image during build would lose the executable bit. So for Windows
clients, the executable bit would be set on all files, unconditionally.

Originally this was detected in the client, which had direct access to
the API response headers, but when refactoring the client to use a common
library in [moby@535c4c9], this was refactored into a `ImageBuildResponse`
wrapper, deconstructing the API response into an `io.Reader` and a string
field containing only the `OSType` header.

This was the only use and only purpose of the `OSType` field, and now that
BuildKit is the default builder for Linux images, this warning didn't get
printed unless BuildKit was explicitly disabled.

This patch removes the warning, so that we can potentially remove the
field, or the `ImageBuildResponse` type altogether.

[moby@4a8b3ca]: 4a8b3cad60
[moby@535c4c9]: 535c4c9a59

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-24 10:26:05 +02:00
Sebastiaan van Stijn
02c8e63545 pkg/watch: remove unused IsWindowsShortReadError
This function was added in b3615d64e2 but
appears to be unused.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-24 09:29:27 +02:00
Sebastiaan van Stijn
ab7a6e9322 pkg/compose: remove uses of deprecated mitchellh/mapstructure module
The github.com/mitchellh/mapstructure module was archived and is no longer
maintained. This module has moved to github.com/go-viper/mapstructure,
which updated to v2, with a minor breaking change in v2.0;

> Error is removed in favor of errors.Join (backported from Go 1.20 to
> preserve compatibility with earlier versions)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-24 09:21:40 +02:00
Nicolas De Loof
2ca7b96e33 resolve secrets based on env var before executing bake
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-09-22 14:56:15 +02:00
Ricardo Branco
a32dc3da72 test: Set stop_signal to SIGTERM
The official nginx images set STOPSIGNAL to SIGQUIT which dumps core.
Set it to SIGTERM to avoid dumping core on e2e tests.

Signed-off-by: Ricardo Branco <rbranco@suse.de>
v2.39.4
2025-09-19 10:31:20 +02:00
Guillaume Lours
db260938c1 bump compose-go to version v2.9.0
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2025-09-19 10:13:08 +02:00
Guillaume Lours
5aea94794c Update comment on run command with tty & piped command
Co-authored-by: Nicolas De loof <nicolas.deloof@gmail.com>
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2025-09-19 09:51:15 +02:00
Guillaume Lours
d07c437ce8 dectect if piped run command and disable tty if so
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2025-09-19 09:51:15 +02:00
Guillaume Lours
da72230c39 remove tty attribute from run options and use dedicated variable to avoid confusion
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2025-09-19 09:51:15 +02:00
Nicolas De Loof
a429c09dfa fix support for build with bake when target docker endpoint requires TLS
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-09-18 11:16:47 +02:00
Guillaume Lours
df3c27c864 add deprecation warning for x-initialSync + e2e test
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2025-09-18 11:06:44 +02:00