Граф коммитов

3674 Коммитов

Автор SHA1 Сообщение Дата
Guillaume Lours 9b863549ee
Merge pull request #9819 from milas/down-image-rm
build: label built images for reliable cleanup on `down`
2022-09-14 10:52:45 +02:00
Milas Bowman 801678686c add license to file
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-09-13 18:29:42 +01:00
Milas Bowman 403d691abf small cleanup + godoc
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-09-13 18:29:33 +01:00
Milas Bowman b49b9ffe7e Merge remote-tracking branch 'upstream/v2' into down-image-rm 2022-09-13 18:00:41 +01:00
Milas Bowman 680763f8b7 down: refactor image pruning
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-09-13 17:23:44 +01:00
Guillaume Lours 1ed37ef7bd
Merge pull request #9812 from milas/go-1.19.1
ci: upgrade to Go 1.19.1
2022-09-13 17:29:34 +02:00
Milas Bowman 42169db166 Merge remote-tracking branch 'upstream/v2' into go-1.19.1 2022-09-13 14:46:15 +01:00
Risky Feryansyah d05f5f5fa7
pull: improve output for services with both image+build (#9829)
When an image pull fails but the service has a `build` section, it
will be built, so it's not an unrecoverable error. It's now logged as
a warning - in situations where the image will _never_ exist in a
registry, `pull_policy: never` can & should be used, which will
prevent the error and avoid unnecessary pull attempts.

Signed-off-by: Risky Feryansyah Pribadi <riskypribadi24@gmail.com>
2022-09-13 14:38:13 +01:00
Guillaume Lours 5cc2c27abb
Merge pull request #9828 from Taha-Chaudhry/v2
Update README.md
2022-09-13 15:31:33 +02:00
Guillaume Lours 7b7189fe00
Merge pull request #9835 from docker/dependabot/go_modules/go.opentelemetry.io/otel-1.10.0
build(deps): bump go.opentelemetry.io/otel from 1.9.0 to 1.10.0
2022-09-13 11:53:45 +02:00
dependabot[bot] de1d969c37
build(deps): bump go.opentelemetry.io/otel from 1.9.0 to 1.10.0
Bumps [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/otel
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-13 09:42:35 +00:00
dependabot[bot] ab984d91af
build(deps): bump github.com/AlecAivazis/survey/v2 from 2.3.5 to 2.3.6 (#9830)
Bumps [github.com/AlecAivazis/survey/v2](https://github.com/AlecAivazis/survey) from 2.3.5 to 2.3.6.
- [Release notes](https://github.com/AlecAivazis/survey/releases)
- [Commits](https://github.com/AlecAivazis/survey/compare/v2.3.5...v2.3.6)

---
updated-dependencies:
- dependency-name: github.com/AlecAivazis/survey/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-13 10:27:14 +01:00
Taha-Chaudhry e413c2137a
Update README.md
Grammar corrections

Signed-off-by: Taha-Chaudhry <46199675+Taha-Chaudhry@users.noreply.github.com>
2022-09-11 17:28:35 +03:00
Milas Bowman 61845dd781
logs: filter to services from current Compose file (#9811)
* logs: filter to services from current Compose file

When using the file model, only attach to services
referenced in the active Compose file.

For example, let's say you have `compose-base.yaml`
and `compose.yaml`, where the former only has a
subset of the services but are both run as part of
the same named project.

Project based command:
```
docker compose -p myproj logs
```
This should return logs for active services based
on the project name, regardless of Compose file
state on disk.

File based command:
```
docker compose --file compose-base.yaml logs
```
This should return logs for ONLY services that are
defined in `compose-base.yaml`. Any other services
are considered 'orphaned' within the context of the
command and should be ignored.

See also #9705.

Fixes #9801.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-09-08 16:26:00 -04:00
Lucas Berg 7a8d157871
convert: do not escape $ into $$ when using the --no-interpolate option (#9703)
Signed-off-by: Lucas Berg <root.lucasberg@gmail.com>
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
Co-authored-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-09-08 16:25:23 -04:00
Laura Brehm 88df5ede42
Merge pull request #9797 from laurazard/start-only-services
Only attempt to start specified services on `compose start [services]`
2022-09-08 13:00:20 -04:00
Laura Brehm a7cc406187
Cleanup E2E tests
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-08 12:49:42 -04:00
Ulysses Souza 126cb988c6
Merge pull request #9817 from ulyssessouza/apply-newly-loaded-envvars
Apply newly loaded envvars to "DockerCli" and "APIClient"
2022-09-08 18:35:51 +02:00
Laura Brehm 4c474fe029
Add unit tests to graph building logic in `dependencies.go`
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-08 12:32:04 -04:00
Laura Brehm 209293e449
Restrict compose project to selected services and dependencies on `compose start`
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-08 12:31:55 -04:00
Ulysses Souza 79af3cdd85 Apply newly loaded envvars to "DockerCli" and "APIClient"
Re-evaluate DockerCli and APIClient after reading the environment file.
I can contain DOCKER_HOST and/or DOCKER_CONTEXT so the DockerCli passed by docker/cli has to be re-evaluated.
Also checks for DOCKER_CERT_PATH and DOCKER_TLS_VERIFY.

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-09-08 18:23:18 +02:00
Guillaume Lours b80222fb07
Merge pull request #9821 from docker/dependabot/go_modules/go.opentelemetry.io/otel-1.9.0
build(deps): bump go.opentelemetry.io/otel from 1.4.1 to 1.9.0
2022-09-08 13:40:37 +02:00
dependabot[bot] ff53411d9d
build(deps): bump go.opentelemetry.io/otel from 1.4.1 to 1.9.0
Bumps [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go) from 1.4.1 to 1.9.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.4.1...v1.9.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/otel
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-08 10:09:55 +00:00
Guillaume Lours 0ac0e29294
Merge pull request #9729 from glours/add-platforms-build
Add platforms build
2022-09-08 11:42:16 +02:00
Milas Bowman bc806da712 build: label built images for reliable cleanup on `down`
When running `compose down`, the `--rmi` flag can be passed,
which currently supports two values:
 * `local`: remove any _implicitly-named_ images that Compose
            built
 * `all`  : remove any named images (locally-built or fetched
            from a remote repo)

Removing images in the `local` case can be problematic, as it's
historically been done via a fair amount of inference over the
Compose model. Additionally, when using the "project-model"
(by passing `--project-name` instead of using a Compose file),
we're even more limited: if no containers for the project are
running, there's nothing to derive state from to perform the
inference on.

As a first pass, we started labeling _containers_ with the name
of the locally-built image associated with it (if any) in #9715.
Unfortunately, this still suffers from the aforementioned problems
around using actual state (i.e. the containers might no longer
exist) and meant that when operating in file mode (the default),
things did not behave as expected: the label is not available
in the project since it only exists at runtime.

Now, with these changes, Compose will label any images it builds
with project metadata. Upon cleanup during `down`, the engine
image API is queried for related images and matched up with the
services for the project. As a fallback for images built with
prior versions of Compose, the previous approach is still taken.

See also:
 * https://github.com/docker/compose/issues/9655
 * https://github.com/docker/compose/pull/9715

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-09-07 17:57:29 -04:00
Milas Bowman f72a604cbd ci: upgrade golangci-lint
Need a compatible version for 1.19

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-09-06 17:59:11 -04:00
Milas Bowman e81168197a ci: upgrade to Go 1.19.1
Go released 1.18.6 + 1.19.1 today which fix a couple
CVEs. (`golang.org/x/net` also has a related fix.)

This jumps from 1.18.5 -> 1.19.1 since it was on the
to-do list regardless :)

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-09-06 17:46:07 -04:00
Laura Brehm 361194472e
Cleanup E2E tests
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-06 20:28:35 +02:00
Guillaume Lours e7b488bb94
Merge pull request #9810 from RiskyFeryansyahP/patch-nil-custom-label
patch: build.go access custom labels directly cause panic
2022-09-06 17:59:03 +02:00
Risky Feryansyah Pribadi 07eb8a598d patch: build.go access custom labels directly cause panic
Signed-off-by: Risky Feryansyah Pribadi <riskypribadi24@gmail.com>
2022-09-06 22:46:55 +07:00
Guillaume Lours 8a9eae3190
Merge pull request #9809 from docker/dependabot/go_modules/github.com/cnabio/cnab-to-oci-0.3.7
build(deps): bump github.com/cnabio/cnab-to-oci from 0.3.6 to 0.3.7
2022-09-06 11:39:25 +02:00
dependabot[bot] 48744dbe47
build(deps): bump github.com/cnabio/cnab-to-oci from 0.3.6 to 0.3.7
Bumps [github.com/cnabio/cnab-to-oci](https://github.com/cnabio/cnab-to-oci) from 0.3.6 to 0.3.7.
- [Release notes](https://github.com/cnabio/cnab-to-oci/releases)
- [Commits](https://github.com/cnabio/cnab-to-oci/compare/v0.3.6...v0.3.7)

---
updated-dependencies:
- dependency-name: github.com/cnabio/cnab-to-oci
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-06 09:27:51 +00:00
Guillaume Lours 44c55e89c0 always use 'docker' export entry when building with 'up' or 'run' commands
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-09-02 15:44:55 +02:00
Guillaume Lours e016faac33 don't push images at the end of multi-arch build (and simplify e2e tests)
support DOCKER_DEFAULT_PLATFORM when 'compose up --build'
add tests to check behaviour when DOCKER_DEFAULT_PLATFORM is defined

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-09-02 15:44:55 +02:00
Guillaume Lours 8ed2d8ad07 add a test with multiple service builds using platforms in the same compose file
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-09-02 15:44:55 +02:00
Guillaume Lours 537f023a3b fix panic when using 'compose up --build'
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-09-02 15:44:55 +02:00
Guillaume Lours 8b1b70833e add support of platforms in build section
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-09-02 15:44:55 +02:00
Guillaume Lours 06ae6d82cb
Merge pull request #9802 from docker/dependabot/go_modules/github.com/docker/go-units-0.5.0
build(deps): bump github.com/docker/go-units from 0.4.0 to 0.5.0
2022-09-01 11:40:04 +02:00
dependabot[bot] 84392d52c4
build(deps): bump github.com/docker/go-units from 0.4.0 to 0.5.0
Bumps [github.com/docker/go-units](https://github.com/docker/go-units) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/docker/go-units/releases)
- [Commits](https://github.com/docker/go-units/compare/v0.4.0...v0.5.0)

---
updated-dependencies:
- dependency-name: github.com/docker/go-units
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 09:28:50 +00:00
Abdullah Shahid Khan c87efed6a4
api: fix typo on Push godoc (#9798)
Signed-off-by: Abdullah Shahid Khan <69131903+Sh9hid@users.noreply.github.com>
2022-08-31 11:18:25 -04:00
Ulysses Souza 36926c41c6
Merge pull request #9715 from ulyssessouza/fix-down-rmi
Fix `down` with `--rmi`
2022-08-30 17:55:42 +02:00
Milas Bowman 24bf9789a6
ci: reduce noise from dependabot on Docker deps (#9770)
There's a complex dependency situation with `docker/docker`,
`docker/cli`, and `docker/buildkit`. Upgrading them usually
needs to happen in unison to ensure compatible versions
between them, particularly because `docker/buildx` is not
1.0, so has no guarantees re: compatibility, and `docker/docker`
& `docker/cli` use CalVer rather than SemVer, so also have
different compatibility guarantees than necessarily expected
by Go tooling.

Patch versions are still considered for these to ensure we
don't miss important bugfixes.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-08-30 08:50:23 -04:00
Laura Brehm cc4f194295
Add E2E tests for starting/stopping single services
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-08-30 12:55:51 +02:00
Ulysses Souza 55cf579e02 Fix `down` with `--rmi`
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-08-29 19:48:23 +02:00
Laura Brehm 1a7c1dfe7d
Merge pull request #9794 from laurazard/fix-exitcode-stop-event
Correctly capture exit code when service has dependencies
2022-08-29 16:26:30 +02:00
Laura Brehm 8301dc8314
Only capture exit codes from `exit` events
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-08-28 21:01:40 +02:00
Laura Brehm 0d2beddf20
Add E2E tests for `up --exit-code-from`
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-08-27 17:44:08 +02:00
CrazyMax 69651136cf
Makefile: mutualize local and Dockerfile build opts (#9776)
Ensure that everything works nicely for `docker-ce-packaging`
as well as local development.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-08-26 16:06:24 -04:00
Milas Bowman f3e0c386d2
Revert "Apply newly loaded envvars to `DockerCli` and `APIClient`" (#9792)
Revert "Merge pull request #9745 from ulyssessouza/apply-newly-loaded-envvars"

This reverts commit 6fe34c45ca, reversing
changes made to 10cfd551e3.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-08-26 16:03:45 -04:00
Nick Sieger 88406491c9
Merge pull request #9786 from nicksieger/individual-checksums
ci: bring back individual checksum files
2022-08-24 09:39:09 -05:00