compose/pkg/e2e/fixtures
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
..
attach-restart Move compose e2e tests into pkg 2021-06-28 08:47:58 +02:00
build-dependencies build: label built images for reliable cleanup on `down` 2022-09-07 17:57:29 -04:00
build-infinite Move compose e2e tests into pkg 2021-06-28 08:47:58 +02:00
build-test ci: use latest stable dockerfile syntax & rename docs Dockerfile (#9711) 2022-08-03 16:36:13 -04:00
cascade-stop-test Move compose e2e tests into pkg 2021-06-28 08:47:58 +02:00
compose-pull Pull image regardless of whether it exists locally if `tag=latest` 2022-08-23 16:57:40 +02:00
cp-test Move compose e2e tests into pkg 2021-06-28 08:47:58 +02:00
dependencies up/start/run: don't wait for disabled service 2022-08-17 12:32:10 -05:00
env-secret add support for setting secret from env variable 2022-06-15 17:06:48 +02:00
environment Fix environment variables priority between environment and .env 2022-07-28 12:57:44 +02:00
init-container Move compose e2e tests into pkg 2021-06-28 08:47:58 +02:00
ipam Move compose e2e tests into pkg 2021-06-28 08:47:58 +02:00
ipc-test Move compose e2e tests into pkg 2021-06-28 08:47:58 +02:00
links e2e: reproduce bug with links 2022-05-31 16:32:29 -05:00
logs-test Move compose e2e tests into pkg 2021-06-28 08:47:58 +02:00
network-alias Move compose e2e tests into pkg 2021-06-28 08:47:58 +02:00
network-links Add links to container create request. 2022-06-02 02:51:25 +02:00
network-test add 2 named networks with close name in the networks test suite to guarantee the good distinction on network names 2022-07-13 15:09:38 +02:00
pause e2e: split out `pause` tests and add more cases 2022-06-28 15:06:17 -04:00
project-volume-bind-test use '-' as separator by default for image name 2022-07-29 18:55:22 +02:00
ps-test e2e: add test for ps 2022-06-08 14:05:20 -05:00
restart-test Move compose e2e tests into pkg 2021-06-28 08:47:58 +02:00
run-test Only start direct dependencies of service on `compose run ...` 2022-06-14 07:32:15 +02:00
sentences Move compose e2e tests into pkg 2021-06-28 08:47:58 +02:00
simple-build-test Make service>build>dockerfile a simple filename 2021-10-20 10:24:08 +02:00
simple-composefile Move compose e2e tests into pkg 2021-06-28 08:47:58 +02:00
start-fail Add E2E tests for `up --exit-code-from` 2022-08-27 17:44:08 +02:00
start-stop Change `projectOrName()` to check COMPOSE_PROJECT_NAME env var 2022-08-03 18:39:39 +02:00
ups-deps-stop up: do not stop dependency containers (#9701) 2022-08-02 15:25:59 -04:00
volume-test Move compose e2e tests into pkg 2021-06-28 08:47:58 +02:00
wrong-composefile Move compose e2e tests into pkg 2021-06-28 08:47:58 +02:00