Commit Graph

137 Commits

Author SHA1 Message Date
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