Skip to content

Conversation

glours
Copy link
Contributor

@glours glours commented Jul 13, 2025

What I did
Add --dry-run support to bake build

> docker compose --verbose up --build --dry-run                                                                              23:28:40
[+] Running 1/1
 ✔ DRY-RUN MODE -  db Pulled                                                                                                                                                           1.1s
[+] Running 10/10
 ✔ DRY-RUN MODE -  web ==> ==> writing image dryRun-ca84d1343b96baa8137c943ed1860e522cacb238                                                                                           0.0s
 ✔ DRY-RUN MODE -  web ==> ==> naming to gloursdocker/avatars-web                                                                                                                      0.0s
 ✔ DRY-RUN MODE -  api ==> ==> writing image dryRun-a033a528b603fed46f861d4b3542c417b99d41c8                                                                                           0.0s
 ✔ DRY-RUN MODE -  api ==> ==> naming to gloursdocker/avatars-api                                                                                                                      0.0s
 ✔ DRY-RUN MODE -  web                                                                       Built                                                                                     0.0s
 ✔ DRY-RUN MODE -  api                                                                       Built                                                                                     0.0s
 ✔ DRY-RUN MODE -  Network avatars_default                                                   Created                                                                                   0.0s
 ✔ DRY-RUN MODE -  Container avatars-api-1                                                   Created                                                                                   0.0s
 ✔ DRY-RUN MODE -  Container avatars-web-1                                                   Created                                                                                   0.0s
 ✔ DRY-RUN MODE -  Container avatars-db-1                                                    Created                                                                                   0.0s
end of 'compose up' output, interactive run is not supported in dry-run mode
> COMPOSE_BAKE=false docker compose --verbose up --build --dry-run                                                           23:30:01
[+] Running 1/1
 ✔ DRY-RUN MODE -  db Pulled                                                                                                                                                           0.9s
[+] Building 0.0s (0/0)                                                                                                                                                docker:desktop-linux
[+] Running 10/10
 ✔ DRY-RUN MODE -  api ==> ==> writing image dryRun-a033a528b603fed46f861d4b3542c417b99d41c8                                                                                           0.0s
 ✔ DRY-RUN MODE -  api ==> ==> naming to gloursdocker/avatars-api                                                                                                                      0.0s
 ✔ DRY-RUN MODE -  web ==> ==> writing image dryRun-ca84d1343b96baa8137c943ed1860e522cacb238                                                                                           0.0s
 ✔ DRY-RUN MODE -  web ==> ==> naming to gloursdocker/avatars-web                                                                                                                      0.0s
 ✔ DRY-RUN MODE -  api                                                                       Built                                                                                     0.0s
 ✔ DRY-RUN MODE -  web                                                                       Built                                                                                     0.0s
 ✔ DRY-RUN MODE -  Network avatars_default                                                   Created                                                                                   0.0s
 ✔ DRY-RUN MODE -  Container avatars-web-1                                                   Created                                                                                   0.0s
 ✔ DRY-RUN MODE -  Container avatars-db-1                                                    Created                                                                                   0.0s
 ✔ DRY-RUN MODE -  Container avatars-api-1                                                   Created                                                                                   0.0s
end of 'compose up' output, interactive run is not supported in dry-run mode

Related issue
fix #13040

(not mandatory) A picture of a cute animal, if possible in relation to what you did
image

@glours glours requested a review from a team as a code owner July 13, 2025 21:32
@glours glours requested a review from ndeloof July 13, 2025 21:32
@glours glours self-assigned this Jul 13, 2025
@glours glours force-pushed the add-dry-run-bake branch from 0a64873 to 96c5583 Compare July 14, 2025 13:57
@ndeloof ndeloof enabled auto-merge (rebase) July 15, 2025 05:48
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
@glours glours force-pushed the add-dry-run-bake branch from 96c5583 to 6e83d05 Compare July 15, 2025 08:40
@ndeloof ndeloof merged commit 0b0242d into docker:main Jul 15, 2025
25 checks passed
@ndeloof ndeloof deleted the add-dry-run-bake branch July 15, 2025 08:52
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jul 28, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [docker/compose](https://github.com/docker/compose) | minor | `v2.38.2` -> `v2.39.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>docker/compose (docker/compose)</summary>

### [`v2.39.1`](https://github.com/docker/compose/releases/tag/v2.39.1)

[Compare Source](docker/compose@v2.39.0...v2.39.1)

#### What's Changed

🔧 Internal

- Add info about models usage to OpenTelemetry spans by [@&#8203;glours](https://github.com/glours) in docker/compose#13094

⚙️ Dependencies

- Bump compose-go to v2.8.1 by [@&#8203;glours](https://github.com/glours) in docker/compose#13096

**Full Changelog**: docker/compose@v2.39.0...v2.39.1

### [`v2.39.0`](https://github.com/docker/compose/releases/tag/v2.39.0)

[Compare Source](docker/compose@v2.38.2...v2.39.0)

#### What's Changed

##### ✨ Improvements

- Add `--since` & `--until` flags to `events` command by [@&#8203;jarqvi](https://github.com/jarqvi) in docker/compose#13030
- Feat(os): add FreeBSD support by [@&#8203;atagtm](https://github.com/atagtm) in docker/compose#13036
- Add `--models` flag to `config` command by [@&#8203;jarqvi](https://github.com/jarqvi) in docker/compose#13022
- Warn user `COMPOSE_BAKE=false` is deprecated by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#13065
- Simpler stop UI by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#13064
- Introduce build `provenance` and `sbom` attributes support by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#13067
- Show build progress during watch rebuild by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#13059

##### 🐛 Fixes

- Add dry-run support to bake build by [@&#8203;glours](https://github.com/glours) in docker/compose#13042
- Keep containers attached on stop to capture termination logs by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#13010
- Add default compose labels to images built from bake by [@&#8203;glours](https://github.com/glours) in docker/compose#13049
- Fix report image name in bake result by [@&#8203;principis](https://github.com/principis) in docker/compose#13047
- Don't run navigation menu if stdin isn't a terminal by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#13054
- Monitor must watch events even when context is cancelled by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#13062
- Force `plain` display mode if stdout isn't a terminal by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#13074
- Do not pass user id on Windows system as engine is not able to handel it by [@&#8203;glours](https://github.com/glours) in docker/compose#13080
- Forward git command error to user by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#13084
- Use output registry when push true and load to docker store if not by [@&#8203;glours](https://github.com/glours) in docker/compose#13085

##### 🔧  Internal

- Add a space character to separate the timestamp from the log message by [@&#8203;xduugu](https://github.com/xduugu) in docker/compose#13038
- Fix the Helm bridge e2e tests after the latest update of the templates by [@&#8203;glours](https://github.com/glours) in docker/compose#13053
- Introduce monitor to manage containers events and application termination by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12906
- Abstract model-cli commands execution with a model (pseudo) API by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#13051
- Swarm by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#13071
- Remove uses of `moby/errdefs` by [@&#8203;thaJeztah](https://github.com/thaJeztah) in docker/compose#13076
- Use local copy of `pkg/system.IsAbs` by [@&#8203;thaJeztah](https://github.com/thaJeztah) in docker/compose#13075
- Optimize ansiColorCode by replacing fmt.Sprintf with strings.Builder by [@&#8203;suwakei](https://github.com/suwakei) in docker/compose#13091
- Eliminate magic number in init functions by [@&#8203;suwakei](https://github.com/suwakei) in docker/compose#13090
- Integration of SetAttributes calls by [@&#8203;suwakei](https://github.com/suwakei) in docker/compose#13089

##### ⚙️ Dependencies

- Bump engine and cli to `v28.3.2` by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#13035
- Build(deps): bump github.com/spf13/pflag from `1.0.6` to `1.0.7` by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in docker/compose#13060
- Bump `compose-go` to version `v2.8.0` by [@&#8203;glours](https://github.com/glours) in docker/compose#13082
- Build(deps): bump google.golang.org/grpc from `1.73.0` to `1.74.2` by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in docker/compose#13081
- bump buildx to `v0.26.1` by [@&#8203;glours](https://github.com/glours) in docker/compose#13086

#### New Contributors

- [@&#8203;atagtm](https://github.com/atagtm) made their first contribution in docker/compose#13036
- [@&#8203;xduugu](https://github.com/xduugu) made their first contribution in docker/compose#13038
- [@&#8203;principis](https://github.com/principis) made their first contribution in docker/compose#13047
- [@&#8203;suwakei](https://github.com/suwakei) made their first contribution in docker/compose#13091

**Full Changelog**: docker/compose@v2.38.2...v2.39.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC42Mi4xIiwidXBkYXRlZEluVmVyIjoiNDAuNjIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] 'docker compose build --dry-run' actually builds the image
2 participants