Commit Graph

488 Commits

Author SHA1 Message Date
Guillaume Tardif b4fa7b2fa3 PS unit test
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-02-11 15:53:06 +01:00
Guillaume Tardif 4140196eb0 Add down unit tests
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-02-11 15:53:05 +01:00
Guillaume Tardif b8093e668a Kill Unit test mocking docker client API
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-02-11 15:52:23 +01:00
Guillaume Tardif bf26d056e5 Fix orphans warning when `docker compose run`
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-02-11 15:34:38 +01:00
Guillaume Tardif c8b708a20b Fix orphans warning when running `docker compose up SERVICE`
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-02-11 15:33:29 +01:00
Nicolas De Loof 8b90814de6
e2e test
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-11 13:26:58 +01:00
Nicolas De Loof d9fe745cc0
avoid use of channels in API for gRPC compatibility
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-11 09:34:08 +01:00
Nicolas De Loof 752edcce65
introduce `--exit-code-from`
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-09 19:17:12 +01:00
Nicolas De Loof a4b003ecfa
pull logs and events better than aggregate events from multiple channels
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-09 17:27:36 +01:00
Nicolas De Loof 06b033db6c `Event` is way too generic noon
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-09 17:07:24 +01:00
Nicolas De Loof 27d640dd41 e2e test and alignment with docker-compose output
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-09 17:07:24 +01:00
Nicolas De Loof f3d093cb54 introduce cascade stop "--abort-on-container-exit" option
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-09 17:07:24 +01:00
Nicolas De Loof 7a7114fb5f Capture container exit code and dump on console
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-09 17:07:24 +01:00
Guillaume Tardif 58e10a7af2 Display warning in `docker compose down` if nothing to remove (no container, no network)
For reference, `docker-compose` displays `WARNING: Network sentences_default not found`

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-02-08 17:20:36 +01:00
Guillaume Tardif ec26ba5230
Merge pull request #1256 from ulyssessouza/e2e-secrets
Add content based e2e tests for configs and secrets
2021-02-08 16:18:36 +01:00
Guillaume Tardif 66fb7903ad
Merge pull request #1246 from ulyssessouza/label-envfiles
Add environment_files label on service's `env_file` section
2021-02-08 16:09:44 +01:00
aiordache 1e7ce90561 Kube backend: add the `compose logs` command
Signed-off-by: aiordache <anca.iordache@docker.com>
2021-02-08 15:19:47 +01:00
Ulysses Souza b9f34a168b Add content based e2e tests for configs and secrets
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-02-08 02:57:02 -03:00
Guillaume Tardif a5b148bda1
Merge pull request #1251 from gtardif/compose_health_display
Remove the HEALTH column in `docker compose ps`
2021-02-05 17:55:04 +01:00
Ulysses Souza dc80f6b6e7 Add environment_files label
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-02-05 10:59:54 -03:00
Guillaume Tardif 24d40ba6ac
Merge pull request #1226 from docker/loglevel
Add support for --log-level
2021-02-05 12:38:13 +01:00
Guillaume Tardif ad140697fc Remove the HEALTH status in `docker compose ps` and combine values from fields “state” and “health”. Rename column STATE => STATUS.
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-02-05 12:19:45 +01:00
Guillaume Tardif 42adbaeb8e
Merge pull request #1250 from docker/fix_logs
Filter out one_off containers on `compose logs`
2021-02-05 11:36:49 +01:00
Nicolas De Loof a1bc5c721d
Filter out one_off containers on `compose logs`
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-05 11:15:43 +01:00
Ulysses Souza 8d8934e449 Add configs bind mount support
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-02-04 19:24:34 -03:00
Nicolas De Loof 9f80214dc2
Make -l -D -H non-persistent to avoid conflict with subcommands
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-04 17:13:44 +01:00
Guillaume Tardif bf56815251 Adding e2e test for local compose healthcheck in compose ps
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-02-03 12:54:22 +01:00
Nicolas De Loof 4cbb33e20d
Add support for --log-level
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-03 11:49:21 +01:00
Nicolas De Loof 0aa3f4a189
Add kill command
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-03 10:44:26 +01:00
Nicolas De loof 4d3d7c11ca
Merge pull request #1211 from docker/health
Add HEALTH column to compose ps
2021-02-02 16:58:26 +01:00
Nicolas De loof 9ef7850076
Merge pull request #1216 from docker/profiles
Introduce --profile option
2021-02-02 16:57:02 +01:00
Nicolas De Loof 9b282b69f8
Introduce --all option on compose ps
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-02 13:58:27 +01:00
Nicolas De Loof b1f864a6f8
Introduce --profile option
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-02 13:51:22 +01:00
Nicolas De Loof c4f6b1bd14
Add HEALTH column to compose ps
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-01 17:40:30 +01:00
Guillaume Tardif 6215445b8a
Merge pull request #1196 from gtardif/kube_expose_LoadBalancer
Support exposing ports and cross-service communication
2021-02-01 15:39:31 +01:00
Guillaume Tardif aa1efb885a Fix kube selectors : do not only select on serviceName, also ProjectName
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-02-01 12:22:41 +01:00
Guillaume Tardif 134744709c
Merge pull request #1201 from ulyssessouza/bump-compose-fo
Bump compose-go for absolute paths fix
2021-02-01 09:19:37 +01:00
Ulysses Souza bf17797070 Adapt tests to use absolute paths
- This also includes IDE linter formating

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-01-30 17:31:56 -03:00
Guillaume Tardif 3252c409f8 Make progress event display homogeneous between up, down, start, stop
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-29 16:51:37 +01:00
Nicolas De Loof 9d9dbf3a1f
Can't set `-f` as shortcut for `--follow` : conflict with `--file`
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-01-29 15:17:44 +01:00
Nicolas De Loof 163f3b9a89 don't run "removeContainers" in parallel as we follow dependency order
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-01-29 15:14:04 +01:00
Nicolas De Loof 7d0e1dfc3c introduce compose logs --tail and --follow options
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-01-29 15:10:56 +01:00
Guillaume Tardif c9028f9f37
Merge pull request #1180 from docker/add-compose-stop
Add start and stop commands
2021-01-29 12:15:24 +01:00
Nicolas De loof c3443410fe
Merge pull request #1190 from docker/recreate_flags
introduce --force-recreate and --no-recreate
2021-01-29 11:25:11 +01:00
Ulysses Souza cd233ceb5c Add defensive code
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-01-28 13:28:53 -03:00
Nicolas De Loof 9e77499c2a
introduce --force-recreate and --no-recreate
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-01-28 15:25:41 +01:00
Ulysses Souza 4ff20bdda8 Add start and stop commands
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-01-27 17:18:10 -03:00
Guillaume Tardif 6a03c4ff03 Fixing linter after rebasing
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-26 18:20:00 +01:00
Guillaume Tardif 3f474143ad
Merge pull request #1163 from docker/stop-on-ctrlc
Stop project on Ctrl+C
2021-01-26 17:08:32 +01:00
Nicolas De Loof f33eff5903
introduce `--filter` option on `compose ls`
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-01-22 10:27:56 +01:00
Dominik Braun effc126237
Make `--file` and `--project-name` global compose options
Signed-off-by: Dominik Braun <mail@dominikbraun.io>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-01-20 14:40:08 +01:00
Ulysses Souza 0529415fa7 Stop project on Ctrl+C
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-01-20 10:02:59 -03:00
Guillaume Tardif 6859413a5d Moving last things from /tests, removing dead code
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-19 15:48:48 +01:00
Guillaume Tardif 46935b0300 Move tests to each backend folder
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-19 15:25:26 +01:00
Nicolas De loof c881e22ab8
Merge pull request #1143 from aiordache/local_volume_override 2021-01-18 21:20:34 +01:00
aiordache 774234750d Parse volumes_from
Signed-off-by: aiordache <anca.iordache@docker.com>
2021-01-18 11:06:09 +01:00
Nicolas De Loof e4682a0565
run "down" using project if it was set for command
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-01-18 10:43:52 +01:00
Guillaume Tardif 2a8c24e4ff Move config => api/config
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-15 16:55:10 +01:00
Guillaume Tardif f1ac6d4fdc Move errdefs => api/errdefs
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-15 16:54:18 +01:00
Guillaume Tardif 930ae8bdb2 goimports -local github.com/docker/compose-cli -w . ; gofmt -s -w .
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-15 16:24:00 +01:00
Guillaume Tardif 801e747adb Move context/cloud => api/cloud
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-15 16:23:53 +01:00
Guillaume Tardif 4dee783aba Move progress => api
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-15 15:57:24 +01:00
Guillaume Tardif 6a8b344885 Move backend => api
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-15 15:44:42 +01:00
aiordache 747d2de397 cleanup
Signed-off-by: aiordache <anca.iordache@docker.com>
2021-01-14 13:20:35 +01:00
aiordache 515f3ba1e7 Revisit volume implementation
Signed-off-by: aiordache <anca.iordache@docker.com>
2021-01-14 12:35:04 +01:00
Guillaume Tardif 8ab3149f45 Network names and volume names don’t need anymore to be re-adapted (and prefixed with project name) after loaded from compose-go
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-14 10:07:29 +01:00
Guillaume Tardif 7dd3a5a1eb Remove duplicate compute of image name & add unit test
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-13 17:30:01 +01:00
Nicolas De Loof 609eeb0962
We actually support volume labels and driver_opts
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-01-13 10:15:57 +01:00
Nicolas De loof 947009d772
Merge pull request #1113 from docker/local_inline_secrets 2021-01-11 10:31:32 +01:00
aiordache 30d6e1b9e2 override inherited secret mounts
Signed-off-by: aiordache <anca.iordache@docker.com>
2021-01-08 16:33:30 +01:00
aiordache ebeef45e85 Implement secrets via bind-mounts for local compose
Signed-off-by: aiordache <anca.iordache@docker.com>
2021-01-08 11:29:14 +01:00
Guillaume Tardif 7a6712afdb Do not inspect for double container name at creation time, this has already been checked, let moby error bubble up if there is a name clash at this stage
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-08 10:59:58 +01:00
Ulysses Souza 0021b14de8 Add unit tests to container_name
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-01-08 10:05:53 +01:00
Ulysses Souza b3993230d1 Add network alias to container name
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-01-07 17:06:40 -03:00
Ulysses Souza b264e1814b Add warning on container_name and scale > 1
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-01-07 17:06:40 -03:00
Ulysses Souza 8976a20698 Use `container_name` property on service
This applies `container_name` when available in
the service definition.

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-01-07 17:06:40 -03:00
Nicolas De loof 1cf48318a4
Merge pull request #1106 from docker/orphans
introduce --remove-orphans option
2021-01-07 10:16:43 +01:00
aiordache 31e40176da Add GPU support via DeviceRequests
Signed-off-by: aiordache <anca.iordache@docker.com>
2021-01-07 10:00:19 +01:00
Nicolas De Loof 4de01936f8
introduce --remove-orphans option
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-01-06 14:36:59 +01:00
Guillaume Tardif 0a5328748a When running compose down, remove containers with Force=true in case some container is still up for any reason (happened in some E2E test once)
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-06 10:07:40 +01:00
Guillaume Tardif df4fed266b
Merge pull request #1095 from docker/push_pull
ignore services without image attribute
2021-01-05 19:13:13 +01:00
Nicolas De Loof 5a455e47c3
ignore services without image attribute
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-01-05 09:47:29 +01:00
Ulysses Souza cef7a2d4ce Refactor ProjectName
This separate project name and service name for command `run`

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-01-04 14:11:54 +00:00
Guillaume Tardif 3714ab7d41 Attaching container logs
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-18 10:01:08 +01:00
Guillaume Tardif db73c928f3 Ensure image exist for run service
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-18 10:01:08 +01:00
Guillaume Tardif dc211b178a Fixed race when down with multiple containers for one service
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-18 10:01:08 +01:00
Guillaume Tardif 32d5644937 Pass reader Writer as options to backend, remove hardcoded os.Stdout
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-18 10:01:06 +01:00
Guillaume Tardif bad0d41d90 Auto-remove using container config
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-18 10:00:19 +01:00
Guillaume Tardif d2cfffafb4 Attach to container using compose attach
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-18 10:00:19 +01:00
Guillaume Tardif 76f36a69c6 Reusing existing Create() and Start() API
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-18 10:00:18 +01:00
Guillaume Tardif 27dc2e5be1 Reuse Create(Project) and Start(Project)
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-18 09:59:02 +01:00
Guillaume Tardif 8eb9733914 No need to support service `container_name` in this PR, will do separately, minor cleanup
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-18 09:59:02 +01:00
Guillaume Tardif d127cac6d4 Ensure images exist before starting progress display for network / volumes, otherwise progress display is all mixed up
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-18 09:59:02 +01:00
Guillaume Tardif 7bed2343e6 Remove not implemented options
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-18 09:59:02 +01:00
Guillaume Tardif b289138ca9 No need to filter services again in backend, filter is done by cli command. Added e2e test, labels one-off and slug
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-18 09:59:02 +01:00
aiordache 412385c495 Add `compose run` command
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-12-18 09:58:55 +01:00
Nicolas De Loof e2c55c2122
e2e test for local `Log` command
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-12-17 11:48:58 +01:00
Nicolas De Loof eda6a59379
introduce options struct in the API
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-12-17 11:10:57 +01:00
Nicolas De Loof 855a879a6a
Introduce `removeOrphans` to cleanup injected AWS simulation container
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-12-17 10:46:17 +01:00
Nicolas De Loof 056dfb95bc
allow to collect logs for a subset of project services
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-12-17 10:32:46 +01:00
Chris Crone 65561c085a deps: Bump docker and buildx vendoring
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-12-16 10:57:42 +01:00
Chris Crone 87153b9d25 local.compose.build: Ensure images are exported
If a user has BUILDX_NO_DEFAULT_LOAD=1 set, then the images will
not be stored in the image store unless we explicitly say that they
must be.

Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-12-11 11:08:49 +01:00
Chris Crone ddaec1a367 compose.build: Wait for progress writer after build
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-12-11 10:40:09 +01:00
Chris Crone 6e76aadfd6 deps: Bump buildx and docker vendoring
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-12-11 10:40:09 +01:00
Djordje Lukic 72cec58ed1 Check if stdin is nil before closing
getContainerStreams returns a nil stdin if the container is already running

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-12-11 10:08:27 +01:00
Guillaume Tardif cf378834e5 No rebuild on compose up if image already exists by default, added first use of compose pull_policy and `compose up --build` to allow to force rebuild.
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-10 18:38:16 +01:00
Nicolas De Loof 446008a4b6
on ACI container ID is `project_service` and name is `service`
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-12-09 14:39:10 +01:00
Nicolas De Loof 1f5a77e67c
move test to command-specific test file
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-12-09 10:33:52 +01:00
Nicolas De Loof 1d859dc807
`Ps` return ContainerSummary, not Services
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-12-09 10:33:51 +01:00
Guillaume Tardif e4ed2b02d7 Fix container attaching to wrong volume name for compose non-external volumes. Took the opportunity to validate R/O volumes, but not related to this fix
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-08 18:48:18 +01:00
Djordje Lukic 033941d890 compose: Add service labels
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-12-08 16:32:30 +01:00
Nicolas De Loof 1eb40999e2
Split compose.go into command-focussed go files
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-12-08 11:58:49 +01:00
Djordje Lukic f6c4c4e590 Move compose e2e tests to own folder
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-12-08 11:30:25 +01:00
Guillaume Tardif 8ee2286126
Merge pull request #1021 from gtardif/fix_down_no_containers
Ensure down continues (removes networks) even if containers have been removed already
2020-12-07 17:33:26 +01:00
Guillaume Tardif b987f2eaf8
Merge pull request #1023 from docker/fix-build-target
Pass the target to buildkit
2020-12-07 17:31:20 +01:00
Guillaume Tardif d0728d94f2 Fix compose volume creation and check this in volume e2e test
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-07 16:57:55 +01:00
Djordje Lukic 7d88fc61d3 Pass the target to buildkit
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-12-07 16:47:58 +01:00
Guillaume Tardif fe363fd146 Fix compose volume creation and check this in volume e2e test
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-07 16:42:43 +01:00
Guillaume Tardif 2657f5804e Ensure down continues (removes networks) even if containers have been removed already. Avoid returning nil error and nil project in `projectFromContainerLabels`
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-07 15:48:57 +01:00
Nicolas De loof 576aa46d21
Merge pull request #1015 from docker/logConsumer
Revisit logs/up API to pass a LogConsumer vs io.Writer
2020-12-07 14:57:43 +01:00
Nicolas De Loof ca123e08eb
Revisit logs/up API to pass a LogConsumer vs io.Writer
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-12-07 14:47:44 +01:00
Guillaume Tardif fea0cf8c82 Fix linter
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-07 14:46:31 +01:00
Guillaume Tardif 6fc8eefb1b Remove build flag for local backend
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-07 14:41:27 +01:00
Guillaume Tardif ec5afcfd4d `compose up` and other compose commands running on “Moby” context type.
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-07 14:41:27 +01:00
Nicolas De Loof 26fe75a7e3
Remove stopped containers on `down`
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-12-07 11:39:21 +01:00
Guillaume Tardif ff1808644c Remove flakyness in compose e2e test : can’t count networks as we have several compose stacks start in //
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-07 09:31:32 +01:00
Guillaume Tardif d0b840bcd1 Fix compose up build when no image name in compose file.
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-04 18:19:34 +01:00
Guillaume Tardif aacd881358 Add -d flag in e2e tests now that `docker compose up` attaches to logs by default
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-04 15:19:12 +01:00
Guillaume Tardif 0b2eaede8c Adding unit test for bind mount creation
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-04 13:49:43 +01:00
Guillaume Tardif 814536c0bd Fixing bind mount with relative path when specifying relative working dir. Added first local compose volume e2e test
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-04 13:49:43 +01:00
Djordje Lukic fcddb77b48 Give progress its own context
The build and progress can't share the same context, the progress context
needs to live longer for the progress to be able to read all the messages
from build.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-12-04 13:05:26 +01:00
Nicolas De loof 6830ca1919
Merge pull request #1006 from gtardif/compose_fix_down_deps
Fix service initial status in graph, in order to fix compose down duplicate removal of container
2020-12-04 11:03:42 +01:00
Nicolas De Loof 136d09e1ac
split `Up` into `Create`+`Start` so logs don't collide with progress
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-12-04 08:16:50 +01:00
Nicolas De Loof 39e4107e12
attach to log stream by default on `up`
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-12-03 16:51:00 +01:00
Djordje Lukic 2f09b634cc Implement `docker compose pull`
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-12-03 16:14:38 +01:00
Guillaume Tardif 56511a4a3a renaming
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-03 15:47:19 +01:00
Guillaume Tardif 44b4bc01af In `compose down` progress display: prefix container names with “Container”, same as Services, Networks, homogeneous with `compose up`
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-03 15:46:37 +01:00
Guillaume Tardif 9d918a8ceb Fix service initial status in graph, in order to fix compose down duplicate removal of container (example : awesome-compose ELK stack)
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-03 15:27:35 +01:00
Guillaume Tardif e469b40e28 Remove duplicate ensureImagesExist()
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-02 13:51:56 +01:00
Ulysses Souza 7e4cfc0e3b Add order to down command
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-12-02 13:51:11 +01:00
Guillaume Tardif 4270f383a7
Merge pull request #988 from docker/feat-platform
Add platform when running containers
2020-12-02 13:24:07 +01:00
Guillaume Tardif 91083bc42c
Merge pull request #1001 from gtardif/compose_build_img_name
If compose file has a build section and no image name, build image with the right derived image tag
2020-12-02 13:16:03 +01:00
Guillaume Tardif 7b1a602fd4 If compose file has a build section and no image name, build image with the right derived image name (project_service), like docker-compose.
See awesome_compose/react-express-mongodb example

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-02 12:05:59 +01:00
Guillaume Tardif 5258e3d56e Add compose build flags for file and working dir
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-02 10:35:28 +01:00
Nicolas De loof 6bf76eebb1
Merge pull request #991 from gtardif/compose_network_error
Compose network error
2020-12-01 18:31:43 +01:00
Nicolas De Loof a35147bc63
Detect push failure and break
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-12-01 16:26:01 +01:00
Nicolas De Loof 52574046f0
introduce `compose push` command
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-12-01 14:55:52 +01:00
Guillame Tardif b1970f618c Container networks: prefix network name only for internal networks or when name set (different from yaml key). No need to prefix again when connecting containers
Signed-off-by: Guillame Tardif <guillaume.tardif@gmail.com>
2020-12-01 10:03:18 +01:00
Guillame Tardif d24ffd97a0 Local compose error when external network not available
Signed-off-by: Guillame Tardif <guillaume.tardif@gmail.com>
2020-11-30 14:49:35 +01:00
Nicolas De Loof 5952183eca
introduce `compose build` command
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-30 12:43:38 +01:00
Djordje Lukic 1148ed8837 Add platform when running containers
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-11-30 11:51:46 +01:00
Guillame Tardif 4d1f265c62 Adding error progress indication when errors
Signed-off-by: Guillame Tardif <guillaume.tardif@gmail.com>
2020-11-27 18:18:14 +01:00
Guillame Tardif 7ddd8e5e97 Helper methods to create progress events, more homogeneous display for “creating”, “Created”, …
Signed-off-by: Guillame Tardif <guillaume.tardif@gmail.com>
2020-11-27 17:55:36 +01:00
Guillame Tardif 8b60c76684 Remove project network on compose down
Signed-off-by: Guillame Tardif <guillaume.tardif@gmail.com>
2020-11-27 17:42:29 +01:00
Guillaume Tardif 9b140930a7
Merge pull request #979 from docker/console
Don't start buildx' build with empty opts
2020-11-27 14:54:39 +01:00
Nicolas De Loof a542b5d37f
Don't start buildx' build with empty opts
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-27 14:18:06 +01:00
Guillame Tardif bc9099de9b Ensure images are pulled/build with build first, before creating networks / volumes and starting containers.
Will also avoid mixing build output and compose-cli progress display

Signed-off-by: Guillame Tardif <guillaume.tardif@gmail.com>
2020-11-27 13:52:58 +01:00
Nicolas De Loof b42b61e307
rename method for clarity
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-27 12:05:57 +01:00
Nicolas De Loof 3ff6923d2e
align coding-style with network labels
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-27 10:51:58 +01:00
Nicolas De Loof 49e653f142
unused context parameter
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-27 10:29:08 +01:00
Nicolas De Loof f65a0d3720
Create volume with labels
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-27 10:21:36 +01:00
Nicolas De Loof 646aca82d9
composeService to rely on apiClient
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-27 10:21:36 +01:00
Guillaume Tardif de3b6cb450 Add compose labels for composefiles
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-11-26 17:13:24 +00:00
Nicolas De loof f7905efc36
Merge pull request #960 from docker/build 2020-11-26 17:58:22 +01:00
Guillaume Tardif e441fbba5a Add compose labels for network
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-11-26 15:45:25 +01:00
Nicolas De Loof 0f4bcb9f17
Build and pull in parallel with BuildKit
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-26 14:11:40 +01:00
Nicolas De Loof a0b609a5dd
implement service image build by BuildKit
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-26 14:07:53 +01:00
Guillaume Tardif 24328c4620 Add container labels to improve compatibility with docker-compose
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-11-25 17:53:12 +01:00
Ulysses Souza 794a182bdd Avoid port collision with compose up test
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-11-24 11:10:17 -03:00
Ulysses Souza 8f8b97d031 Fix linter issues when running `make lint`
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-11-23 17:05:40 -03:00
Djordje Lukic 5ffdaa5cca Use json progress message
It contains the same output that `docker pull` shows

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-11-23 10:00:13 +01:00
Djordje Lukic be40bdb032 Remove useless Done in the progress writer
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-11-22 17:30:28 +01:00
Djordje Lukic 5cf5410bc8 Detect cycles
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-11-21 23:58:12 +01:00
Djordje Lukic 1f43b83409 Use a dependency graph to start services
The algorithm is like so:
* get all the leaves of the graph, these are all the service that don't have any dependency
* once a service is started we take the list of its parents (dependents)
* if all the dependencies of each of those dependents are started then we can start it as well
* if not then we continue to the next dependent

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-11-21 22:30:32 +01:00
Guillaume Tardif aa534979bc First local compose e2e tests
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-11-20 18:06:11 +01:00
Nicolas De Loof 98cc5cc1eb
Fix processing dependency graph only onces per node
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-20 17:56:27 +01:00
Nicolas De loof b3f406f410
Merge pull request #924 from docker/dependecy_order 2020-11-20 15:45:15 +01:00
Nicolas De Loof eeb09d9e80
apply linter recommendations
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-19 17:35:34 +01:00
Nicolas De Loof e7284e76e9
Process services in dependency order as a graph
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-19 17:31:58 +01:00
Guillaume Tardif ff84803546 compose ps implementation
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-11-19 13:34:43 +01:00
Nicolas De Loof 7c7e75ca00
Ensure extensions map is not nil (should be set by compose-go)
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-19 13:10:55 +01:00
Nicolas De Loof 251c52664a
Implement service_healthy dependency condition
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-19 13:10:55 +01:00
Nicolas De Loof adb62e9080
Run convergence in service dependency order
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-19 13:10:13 +01:00
Guillaume Tardif 9f594abd85 Local compose ls implementation
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-11-19 09:48:54 +01:00
Guillaume Tardif 51142827e7 Fix linter errors
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-11-18 17:18:41 +01:00
Nicolas De Loof eb60bbb74f
define const for labels
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-17 15:56:39 +01:00
Nicolas De Loof 2278370ffa
Handle service scale with container numbering
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-17 15:15:27 +01:00
Guillaume Tardif da99ad40d5 Fix logs (concurrent access to container.ID, logs was displaying the first container logs for every container)
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-11-17 15:13:36 +01:00
Nicolas De Loof a701fd7601
Negociate API version with docker engine
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-17 13:44:51 +01:00
Nicolas De Loof 46cbb908fe
Target docker/docker 19.03 branch (api 1.40)
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-17 13:28:58 +01:00
Nicolas De Loof 6346db1d6f
Move reconciliation logic into convergence.go
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-17 11:31:14 +01:00
Nicolas De Loof 8310bb2a91
Create services in dependency order
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-17 11:31:14 +01:00
Djordje Lukic 744aebc3fd
"Already exists" also means the pull finished
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-11-17 11:31:14 +01:00
Djordje Lukic b0ee6d285a
Update docker/docker to be able to run this on a Mac, use goroutines when starting a stack
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-11-17 11:31:13 +01:00
Nicolas De Loof 9fdf69ea9c
Handle container (re)create/(re)start on compose up
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-17 11:29:12 +01:00
Nicolas De Loof 0d33e5cdcc
report docker resources creation in progress
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-17 11:28:50 +01:00
Nicolas De Loof 7944a1b94f
implement image pull on `compose up` with progress
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-17 11:28:49 +01:00
Nicolas De Loof 74de423cc3
reuse ECS logConsumer to implement formatted compose log output
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-17 11:28:08 +01:00
Nicolas De Loof 3f52508efe
Skeletton implementation for compose commands
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-17 11:28:08 +01:00
Nicolas De Loof 85ec312461
convert compose model into moby API types to prepare "up" local implementation
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-11-17 11:28:08 +01:00
Chris Crone 74a27541e4 backend.local: Add volume e2e test
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-11-04 15:50:28 +01:00
Chris Crone db3a14694b backend.local: Add command support
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-11-04 10:43:04 +01:00
Chris Crone 42eb0ecc35 backend.local: Add rudimentary volume support
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-11-04 09:54:29 +01:00
Chris Crone 637dd263c9 backend.local: Refactor container service
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-11-04 09:54:29 +01:00
Chris Crone b2dcae685a backend.local: Add restart policy support to run
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-11-04 09:54:29 +01:00
Chris Crone b8adb4b3dd backend.local: Refactor conversion code
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-11-04 09:54:29 +01:00
Chris Crone 6a9eca9bdf backend.local: Add memory limits
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-11-04 09:54:29 +01:00
Chris Crone 47aa069a3d backend.local: Add CPU limits
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-11-04 09:54:29 +01:00
Chris Crone 42f31d3129 backend.local: Improve inspect
* Add restart policy
* Add environment
* Add labels
* Add auto remove

Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-11-04 09:54:29 +01:00
Chris Crone dce884d5c8 backend.local: Set environment on run
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-11-04 09:54:29 +01:00
Chris Crone 25e6a18fef backend: Add --rm support to local backend
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-10-30 18:19:02 +01:00
Guillaume Tardif 7cf7b00584 Add ResourceService definition and ACI NOOP implementation
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-10-14 15:40:24 +02:00
Chris Crone d154c41586 Update copyright
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-09-22 12:13:00 +02:00
Guillaume Tardif 08562b403e Connecting it all
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-09-08 15:30:50 +02:00
Guillaume Tardif 9ed06ece5b Adding volume API & initial CLI command
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-09-08 15:30:50 +02:00
Guillaume Tardif d06aa2827f Move containers, compose, secrets to /api
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-09-07 13:22:08 +02:00
Ulysses Souza 15066ce999 Add 'kill' command
- On ACI that's implemented as a stop,
since ACI does not implement a kill

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-09-04 02:57:54 +02:00
Guillaume Tardif ad5c465bd1
Merge pull request #485 from docker/repo-rename
Rename docker/api -> docker/compose-cli
2020-08-25 15:58:51 +02:00
Guillaume Tardif 981665b02c Better renaming
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-08-24 16:09:20 +02:00
Guillaume Tardif 2bac8cf94e Fix linter
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-08-21 21:28:15 +02:00
Guillaume Tardif da6334f415 Renaming, expect commands to succeed by default (removed a bunch of res.Assert(success) )
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-08-21 18:45:38 +02:00
Chris Crone 4c6280b0e9 Rename docker/api -> docker/compose-cli
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-08-21 17:28:39 +02:00
Nicolas De Loof 6e6a11aa73
Introduce Secrets API
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-18 09:43:15 +02:00
Djordje Lukic 1a3182fb7f Implement `docker start` for ACI 2020-08-12 14:50:47 +02:00
Djordje Lukic 093a69136f Add --force to rm on ACI
If a container is running the user must force the removal of the
container.
2020-08-11 16:30:42 +02:00
Chris Crone 017053e19a tests.e2e: Refactor
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-08-10 14:12:46 +02:00
Djordje Lukic ef2d304762 Allow non-interactive exec on ACI
If the request is for a non-interactive exec we don't attach the stdin
when executing.
2020-07-09 11:47:22 +02:00
Guillaume Tardif 7296290408 Add ”Platform” in docker inspect result, showing container OS (this field is used by VSCode) 2020-07-06 12:16:02 +02:00
Guillaume Tardif 5eea111ecf Run containers and attach to logs by default, detach with -d option 2020-07-02 16:45:04 +02:00
Djordje Lukic ad72c866cc Add license headers 2020-06-18 16:48:03 +02:00
Guillaume Tardif 34d01012e4 Relax constraints on flaky tests (due to // runs) 2020-06-17 08:58:24 +02:00
Guillaume Tardif 9257d0ff49
Merge pull request #205 from ulyssessouza/inspect
Add inspect command
2020-06-16 09:33:33 +02:00
Djordje Lukic a80653c27c
Merge pull request #219 from rumpl/chore-build-without-backends
Build example and local backend conditionaly
2020-06-15 12:24:40 -07:00
Djordje Lukic 39042aa8bd Build example and local backend conditionaly
* `make` will build the cli with all backends exnabled
* `make cross` will cross build without the example and local backend

You can still cross compile with all backends by doing

```console
$ BUILD_TAGS=example,local make cross
```

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-06-15 18:02:30 +02:00
Ulysses Souza 1039c5ed94 Add tests on inspect
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-06-15 17:20:37 +02:00
Guillaume Tardif eb505ecd75 Add -f option to force remove current context and switch to default if required 2020-06-15 16:28:43 +02:00
Ulysses Souza 96bc1ca6f1 Add inspect command
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-06-15 15:08:04 +02:00
Guillaume Tardif 0de2522079 Renamed Moby backend to “local” backend. This will leave “moby” available for default type contexts 2020-06-15 12:20:03 +02:00