Nicolas De Loof
a0acc20d88
introduce --parallel to limit concurrent engine calls
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-12-06 08:15:50 +01:00
Milas Bowman
053f20edab
port: improve error-handling if port not found ( #10039 )
...
This method looked slightly incomplete. If the port wasn't found,
it'd return `err`, but that was always `nil`, so we'd print out
`:0`.
Now, we construct a nice error message with the targeted port and
the ones we found.
The `--protocol` flag is also now case-insensitive to prevent any
weirdness/confusion there.
Co-authored-by: Nick Sieger <nicksieger@gmail.com>
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-12-05 22:11:45 +00:00
Milas Bowman
113fb6732d
schema: add support for tmpfs.mode in mount definition ( #10031 )
...
See compose-spec/compose-go#325 for the acutal spec change. This
propagates it to the Engine API object and adds an E2E test via
Cucumber 🥒
Fixes #9873 .
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-12-02 11:21:53 -05:00
i-ky
c74a77e895
Make use of Containers.filter() and isService()
...
Signed-off-by: i-ky <gl.ivanovsky@gmail.com>
2022-12-02 12:16:35 +01:00
i-ky
7f975fa40b
Fix replacing "service:x" with "container:y"
...
Signed-off-by: i-ky <gl.ivanovsky@gmail.com>
2022-12-02 12:16:35 +01:00
Nicolas De Loof
8f2b747104
use DistributionInspect to resolve image digest
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-11-30 21:18:18 +01:00
Nicolas De Loof
9ac4f69918
move image digests resolution to backend
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-11-30 21:18:18 +01:00
Guillaume Lours
707d55c77f
add file header and cleanup profiles e2e tests
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-11-30 13:21:16 +01:00
Guillaume Lours
5edd783032
add e2e tests to check profile activation via targeted service
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-11-30 13:21:16 +01:00
Guillaume Lours
6fbef29619
add e2e tests to check no profile usages
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-11-30 13:21:16 +01:00
Guillaume Lours
7fe43a8b4a
add e2e tests using explicitly profiles
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-11-30 13:21:16 +01:00
Nicolas De Loof
ed38fe0da8
only stop services started by `up` on interruption
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-11-30 08:07:20 +01:00
Nicolas De Loof
fb5b90ed47
implement support for oom_score_adj
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-11-25 09:03:12 +01:00
Guillaume Lours
10a5d998e6
useDockerDefaultOrServicePlatform fct should return service.platform if defined
...
and present in the build.platforms list (or if the list is empty)
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-11-25 09:03:03 +01:00
Guillaume Lours
02818ba6c7
Merge pull request #9998 from glours/display-engine-warnings
...
display creation warnings from the engine
2022-11-21 15:17:26 +01:00
Guillaume Lours
481ae0aa7d
Merge pull request #9999 from glours/pull-use-default-platform
...
use platform defined by DOCKER_DEFAULT_PLATFORM when pulling and no service platform defined
2022-11-18 14:27:41 +01:00
Nicolas De Loof
19d6ca9c5d
ignore error parsing container number label, just warn
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-11-17 15:18:28 +01:00
Guillaume Lours
7c5675c306
use platform defined by DOCKER_DEFAULT_PLATFORM when pulling and no service platform defined
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-11-16 13:51:44 +01:00
Guillaume Lours
a077e8a24b
display creation warnings from the engine
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-11-15 18:12:14 +01:00
Guillaume Lours
8c1e2af3e1
add e2e tests to check build dependency between services
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-11-15 14:43:53 +01:00
Guillaume Lours
a9e070206e
check if a missing image won't be build via a service declared in depends_on section
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-11-15 14:43:53 +01:00
Sebastiaan van Stijn
34e945a598
ci: remove uses of deprecated gotest.tools v2 ( #9935 )
...
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-11-07 14:07:41 -05:00
Laura Brehm
df9e605b31
Merge pull request #9947 from glours/manage-resources-reservations
...
add support of deploy.reservation.memory
2022-11-02 16:09:14 +01:00
Guillaume Lours
7ba9aac5da
add support of deploy.reservation.memory
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-10-24 22:52:34 +02:00
Guillaume Lours
eaf27d9dfe
map deploy.restart_policy.condition to engine values
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-10-24 11:38:49 +02:00
Laura Brehm
dd13299ede
Skip flaky test in CI
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-10-20 18:30:27 +02:00
Guillaume Lours
3f0550f884
log the error object instead of the string message only
...
Co-authored-by: Nick Sieger <nicksieger@gmail.com>
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-10-18 17:34:16 +02:00
Guillaume Lours
18ce1f41b7
replace deprecated functions
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-10-18 16:57:53 +02:00
Guillaume Lours
3bf29d401c
bump docker dependencies version
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-10-18 16:26:54 +02:00
Ulysses Souza
91eae4f035
Add Codecov
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-10-17 15:32:51 +02:00
Tiago Silva
8b89721476
port: fix container name in error message ( #9909 )
...
The error message is using V1 separator hardcoded, it should be using the configured separator value.
Signed-off-by: Tiago Silva <Tiago.MB.Silva@edu.azores.gov.pt>
2022-10-13 14:47:35 -04:00
Vedant Koditkar
1d4cb32001
Add support to push images quietly via compose cli
...
Signed-off-by: Vedant Koditkar <vedant.koditkar@outlook.com>
2022-10-11 15:19:23 -05:00
Guillaume Lours
b6b58d26c1
don't fail when trying to remove an orphan container during down command
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-10-06 16:44:37 +02:00
Laura Brehm
25c4bcef85
Merge pull request #9824 from laurazard/cucumber-test
...
🥒 Cucumber PoC 🥒
2022-09-27 23:38:44 +02:00
Milas Bowman
616777eb4a
deps: fix race condition during graph traversal ( #9878 )
...
Keep track of visited nodes to prevent visiting a service multiple
times. This is possible when a service depends on multiple others,
as an attempt could be made to visit it from multiple parents.
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-09-27 09:01:13 -04:00
Laura Brehm
fffe7fff57
Create new `e2e` module to separate out test dependencies, move cucumber tests
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-27 02:13:52 +02:00
Laura Brehm
0a5f4e62e4
Removed tests that were replaced by Cucumber features
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-27 02:13:52 +02:00
Laura Brehm
266ab22d53
Rename start cucumber feature
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-27 02:13:51 +02:00
Laura Brehm
a7476c8eeb
Convert `cascade_stop_test.go` into a cucumber feature `stop.feature`
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-27 02:13:51 +02:00
Laura Brehm
15ebff00b1
Cucumber test setup/fixtures
...
(run with `go test -v -run ^TestCucumberFeatures$ github.com/docker/compose/v2/pkg/e2e/cucumber`)
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-27 02:13:47 +02:00
Bartłomiej Klimczak
aa297a9969
remove unnecessary code
...
Signed-off-by: Bartłomiej Klimczak <bartlomiej.klimczak88@gmail.com>
2022-09-26 20:54:33 +02:00
Bartłomiej Klimczak
0d0a02cc6b
add more information when service.platform isn't part of service.build.platforms
...
Signed-off-by: Bartłomiej Klimczak <bartlomiej.klimczak88@gmail.com>
2022-09-26 20:44:59 +02:00
Guillaume Lours
279225896a
run: clean service command if entrypoint is overridden ( #9836 )
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-09-26 12:08:14 -04:00
Guillaume Lours
ce3700d334
keep the platform defined, in priority, via DOCKER_DEFAULT_PLATFORM or the service.plaform one if no build platforms provided
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-09-22 13:46:24 +02:00
Guillaume Lours
e2a3fe9427
Merge pull request #9862 from glours/use-docker-export-if-no-build-platforms
...
configure default builder export when no build.platforms defined
2022-09-22 13:46:00 +02:00
Laura Brehm
94465d57cc
Merge pull request #9863 from docker/gha-win-mac-runners
...
Add `merge` GitHub Actions workflow to run tests on Windows and macOS runners
2022-09-21 16:39:27 +02:00
Laura Brehm
a1984ca1de
Skip some tests in CI due to flakiness
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-20 11:33:31 -04:00
Laura Brehm
118b4f07e5
Increase E2E test timeouts to reduce flakiness
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-20 11:33:31 -04:00
Laura Brehm
8714f983ac
Temporarily disable broken E2E tests on Windows
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-20 11:33:31 -04:00
Laura Brehm
937fa2dc8f
Add GitHub Action workflow to run tests on Mac/Windows runners
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-20 11:33:28 -04:00
Guillaume Lours
71ab6c9eef
configure default builder export when no build.platforms defined
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-09-20 15:27:41 +02:00
Guillaume Lours
a1c50ef2c9
keep the platform defined via DOCKER_DEFAULT_PLATFORM during build if no build platforms provided
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-09-16 22:19:31 +02:00
Laura Brehm
2977f4c897
Merge pull request #9849 from laurazard/fix-volumesfrom-overwriting
...
Keep `depends_on` condition when service has `volumes_from`
2022-09-15 10:45:48 -04:00
Laura Brehm
cfdec21a7f
Fix linting issues
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-15 10:04:06 -04:00
Laura Brehm
b564cc5a17
Don't overwrite existing dependency condition
...
(when service has `volumes_from` another service with dependency condition)
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-15 09:53:52 -04:00
Laura Brehm
43c444e890
Add unit tests for `PrepareVolumes`
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-15 09:53:14 -04:00
Guillaume Lours
0e975262da
keep the platform defined at service level during build if no build platforms provided
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-09-15 08:30:52 +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
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
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
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
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
Laura Brehm
361194472e
Cleanup E2E tests
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-06 20:28:35 +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
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
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
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
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
Laura Brehm
e5eb00f618
Merge pull request #9781 from laurazard/pull-image-latest
...
Pull image regardless of whether it exists locally if `tag=latest`
2022-08-23 17:49:41 +02:00
Laura Brehm
235734823e
Pull image regardless of whether it exists locally if `tag=latest`
...
... and pull policy is `missing` or `if_not_present`
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-08-23 16:57:40 +02:00
Michael Irwin
d23c261c7d
Remove error message showing exit code when using --exit-code-from
...
Signed-off-by: Michael Irwin <mikesir87@gmail.com>
Resolves #9782
2022-08-23 10:47:54 -04:00
Nick Sieger
5723dee316
pull: only skip pull when policy is `missing`/`if_not_present`
...
Fixes #9773 .
Signed-off-by: Nick Sieger <nick@nicksieger.com>
2022-08-22 09:22:20 -05:00
Laura Brehm
f880b4129c
Merge pull request #9173 from KoditkarVedant/8768-avoid-pulling-same-image-multiple-times
...
Avoid pulling same images multiple times ⚡ ️
2022-08-19 16:28:55 +02:00
Vedant Koditkar
a1d19119d2
Fix breaking test
...
Signed-off-by: Vedant Koditkar <vedant.koditkar@outlook.com>
2022-08-19 15:25:22 +05:30
Vedant Koditkar
b96b5449e5
Merge branch 'v2' into 8768-avoid-pulling-same-image-multiple-times
2022-08-19 13:08:36 +05:30
Laura Brehm
fcfcc1524e
Apply compose model on `compose kill`, add `--remove-orphans`
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-08-19 04:26:08 +02:00
Ulysses Souza
6fe34c45ca
Merge pull request #9745 from ulyssessouza/apply-newly-loaded-envvars
...
Apply newly loaded envvars to "DockerCli" and "APIClient"
2022-08-18 22:49:21 +02:00
Ulysses Souza
0b4cb85c84
Code formatting
...
Just moving it up to make clearer
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-08-18 22:41:02 +02:00
Ulysses Souza
3f4f4e5975
Give environment variables precedence back to OS over .env
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-08-18 22:39:21 +02:00
Nick Sieger
09e6b0292a
up/start/run: don't wait for disabled service
...
Signed-off-by: Nick Sieger <nick@nicksieger.com>
2022-08-17 12:32:10 -05:00
Nick Sieger
3c561e7017
create: pull all services logic out of loop; add DependsOn deps
...
Signed-off-by: Nick Sieger <nick@nicksieger.com>
2022-08-17 11:48:45 -05:00
Vedant Koditkar
293cf21c58
Merge branch '8768-avoid-pulling-same-image-multiple-times' of github.com:KoditkarVedant/compose into 8768-avoid-pulling-same-image-multiple-times
2022-08-14 16:52:17 +05:30
Vedant Koditkar
25f4cb2ee6
Use compose to pull image twice
...
Signed-off-by: Vedant Koditkar <vedant.koditkar@outlook.com>
2022-08-14 16:51:29 +05:30
Vedant Koditkar
817e875cbf
Merge branch 'v2' into 8768-avoid-pulling-same-image-multiple-times
2022-08-13 12:19:49 +05:30
Vedant Koditkar
79ed1290a6
Use alpine:3.13.12 to be unique across the test cases
...
Signed-off-by: Vedant Koditkar <vedant.koditkar@outlook.com>
2022-08-13 02:59:44 +05:30
Vedant Koditkar
4853ace155
Fix package name
...
Signed-off-by: Vedant Koditkar <vedant.koditkar@outlook.com>
2022-08-13 02:06:28 +05:30
Vedant Koditkar
de49bea774
Try changing package used to avoid any race condition in tests
...
Signed-off-by: Vedant Koditkar <vedant.koditkar@outlook.com>
2022-08-12 23:06:51 +05:30
CrazyMax
5ec20296e4
Better sandboxed workflow and enhanced cross compilation
...
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-08-12 15:05:58 +02:00
Vedant Koditkar
0db6dfee03
make compose pull tests more expressive
...
Signed-off-by: Vedant Koditkar <vedant.koditkar@outlook.com>
2022-08-10 21:48:27 +05:30
Milas Bowman
27227a8824
lint: add `nolintlint` and clean up `nolint` directives ( #9738 )
...
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-08-09 16:43:58 -04:00
Milas Bowman
12ad0fddab
lint: run gofmt from Go 1.19 ( #9728 )
...
Fix comment formatting.
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-08-08 11:36:57 -04:00
Vedant Koditkar
e623b5ca1e
Merge branch 'v2' into 8768-avoid-pulling-same-image-multiple-times
2022-08-06 17:58:10 +05:30
Milas Bowman
1ee44a0acb
config: use correct YAML marshal func ( #9712 )
...
The `compose-spec/compose-go` lib is written with `gopkg.in/yaml.v2`
as a target.
When marshalling via CLI (`compose convert` / `compose config`), we
were using a _different_ YAML lib, which was a fork of `go-yaml`,
which is what `gopkg.in/yaml.v2` is based off of.
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-08-03 20:41:43 +00:00
Sebastiaan van Stijn
92f32b5c79
ci: use latest stable dockerfile syntax & rename docs Dockerfile ( #9711 )
...
* update dockerfiles to use latest stable syntax
Some Dockerfiles were pinned to a minor release, which meant they
wouldn't be updated to get the latest stable syntax (and fixes),
and one Dockerfile used the "labs" variant to use the HEREDOC syntax,
which has now been promoted to the stable syntax.
* docs: rename Dockerfile
There's no other Dockerfiles in the same path, so the "docs"
prefix was redundant.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-03 16:36:13 -04:00
Laura Brehm
c586ca4d0e
Change `projectOrName()` to check COMPOSE_PROJECT_NAME env var
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-08-03 18:39:39 +02:00
Laura Brehm
be495ab8e6
Filter `compose ps` output by provided compose model
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-08-02 22:33:26 +02:00
Laura Brehm
d2a6c2c200
Add E2E tests for `compose stop` with compose file
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-08-02 22:33:26 +02:00
Nicolas De Loof
f6e96dd783
if command is ran with a compose file, apply the compose model, not just project name
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-08-02 22:33:26 +02:00
Milas Bowman
765c071c89
up: do not stop dependency containers ( #9701 )
...
This keeps parity with v1, where only the containers explicitly
passed to `up` are torn down when `Ctrl-C` is hit, so any
dependencies that got launched (or orphan containers hanging
around) should not be touched.
Fixes #9696 .
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-08-02 15:25:59 -04:00
ikedam
bbaaa6a9de
config: case-insensitive env vars on Windows ( #9438 )
...
Signed-off-by: IKEDA Yasuyuki <devld@ikedam.jp>
2022-08-02 14:56:09 -04:00
Sebastiaan van Stijn
9db79856be
update usage strings for consistency
...
This updates the format of various usage strings to be more consistent
with other parts of the CLI.
- Use `[OPTIONS]` to indicate where command-specific options should be added
- Use `[SERVICE...]` to indicate zero-or-more services
- Remove some usage strings for specific options (e.g. `-e NAME=VAL`), as that
option is part of the already mentioned `[OPTIONS]` and we don't provide usage
for each possible option that can be passed.
- Remove `[--]`, which (I think) was needed for the Python implementation, but is
a general feature to stop processing flag-options.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-02 13:32:29 +02:00
Guillaume Lours
052469104f
switch tests back to '_' separator for networks and volumes
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-08-01 17:25:43 +02:00
Jeremiah Millay
8d84a12333
Fix LinkLocalIPs in V2
...
Signed-off-by: Jeremiah Millay <jmillay@fastly.com>
2022-07-29 21:19:34 +02:00
Ulysses Souza
9a131a0734
Merge pull request #9690 from ulyssessouza/fix-bump-compose-go-1.3.0
...
Fix go.mod on replace for compose-go
2022-07-29 20:59:36 +02:00
Ulysses Souza
c98e8ac3e1
Fix go.mod on replace for compose-go
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-07-29 20:49:10 +02:00
Kenny Millington
1d678b70d9
config: ignore image for config hash generation ( #9350 )
...
Do not set Image so it does not impact the config-hash
Signed-off-by: Kenny Millington <kenny@kennynet.co.uk>
2022-07-29 14:01:52 -04:00
Guillaume Lours
6d613c8cb2
Merge pull request #9636 from ulyssessouza/dotenvfile-priority
...
Environment variables priority
2022-07-29 19:42:50 +02:00
Guillaume Lours
150fd4b8cf
use '-' as separator by default for image name
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-07-29 18:55:22 +02:00
Guillaume Lours
b49bd7c6ce
Merge pull request #9179 from ndeloof/no_build_image
...
as --no-build is set, set service image to default image name
2022-07-29 17:50:01 +02:00
Nicolas De Loof
abf5f736c7
as --no-build is set, set service image to default image name
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-07-29 17:41:53 +02:00
Robert Schumacher
f69dec2da8
Fixes #9403 : Remove Named Pipes from volumeMounts
...
If named pipe mounts are added to the volumeMounts mapping, the docker daemon will report an error that it cannot be mapped.
Signed-off-by: Robert Schumacher <ras0219@outlook.com>
2022-07-29 02:17:32 +02:00
Ulysses Souza
e9c8cfcef3
Fix environment variables priority between environment and .env
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-07-28 12:57:44 +02:00
Ulysses Souza
bac398aa9f
Fix .env and --envfile priorities
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-07-28 12:13:37 +02:00
Guillaume Lours
c4b9ec6301
remove unused sessionConfig param for addSecretsConfig function
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-07-22 17:37:42 +02:00
Guillaume Lours
75bbd245c7
Merge pull request #9647 from glours/add-test-named-networks
...
add 2 named networks with close name in the networks test suite to gu…
2022-07-19 16:55:26 +02:00
Guillaume Lours
d85751f6d4
Merge pull request #9641 from glours/fix-volumes_from
...
keep the container reference when volumes_from target a container and not a service
2022-07-15 18:29:14 +02:00
Ulysses Souza
fc723acb3b
Fix nolint issues
...
Reference -> https://golangci-lint.run/usage/false-positives/#nolint-directive
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-07-13 19:33:06 +02:00
Ulysses Souza
96cbb1cbcf
Add "style" tag to gocritic
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-07-13 19:33:06 +02:00
Ulysses Souza
d42adf6efb
Add "opinionated" tag to gocritic
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-07-13 19:33:06 +02:00
Ulysses Souza
a81f23a199
Add "diagnostic" tag to gocritic
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-07-13 19:33:06 +02:00
Ulysses Souza
2e96829607
Add gocritic to linters
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-07-13 19:33:03 +02:00
Guillaume Lours
966cbb59ac
add 2 named networks with close name in the networks test suite to guarantee the good distinction on network names
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-07-13 15:09:38 +02:00
Guillaume Lours
9fdd7d81b3
Merge pull request #9640 from glours/fix-close-network-name-issue
...
Fix issue with close networks name on up and down command
2022-07-13 10:46:13 +02:00
Guillaume Lours
f30f9d9692
keep the container reference when volumes_from target a container and not a service
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-07-12 13:17:46 +02:00
Pablo Rodriguez Quesada
eb06e1ca56
build.go: Access customLabels directly instead of by reference
...
Accesing the map directly instead of the copy value, otherwise the label doesn't get set.
Signed-off-by: Pablo Rodriguez <pablo.aarch64@gmail.com>
2022-07-11 08:52:23 -06:00
Guillaume Lours
50aa9750ee
check the exact network's name before creating or stopping it
...
NetworkList API doesn't return the extact name match, so we can retrieve more than one network with a request
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-07-11 12:17:22 +02:00
Vedant Koditkar
960453fa22
Merge branch 'v2' into 8768-avoid-pulling-same-image-multiple-times
2022-07-04 22:00:04 +05:30
Guillaume Lours
4debb133a7
add support of environment secret during build step
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-07-01 11:21:49 +02:00
Milas Bowman
4aa8c4a1e5
e2e: add more start/stop test cases
...
* Starting a service that's already running
* Stopping a service that's already stopped
* Starting/stopping multiple services (by name) at once
Also renamed a test that was about `up` behavior but was
misleadingly labeled start/stop.
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-30 09:52:14 -04:00
Milas Bowman
06649442eb
Merge pull request #9609 from milas/e2e-pause
...
e2e: split out `pause` tests and add more cases
2022-06-30 08:42:59 -04:00
Guillaume Lours
cd940693aa
Merge pull request #9049 from ndeloof/9044
...
(re)start should not impact one-off containers
2022-06-29 10:43:10 +02:00
Laura Brehm
96b152f705
Update logic to keep `compose stop` and `restart` from affecting one-offs
...
Also add e2e tests.
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-06-29 00:58:02 +02:00
Milas Bowman
8e7b6582d4
Merge pull request #9595 from abhinavnair/replace-ioutil
...
Replace deprecated ioutil pkg with os & io
2022-06-28 15:08:57 -04:00
Milas Bowman
26014d49a5
e2e: split out `pause` tests and add more cases
...
Pause/unpause was being partially tested under the start/stop test.
This removes it from that test and adds dedicated pause + unpause
tests.
Note that the tests assert on current behavior, though it's been
noted where that is undesirable due to divergence from the Docker
CLI. Will change the behavior + update tests in a subsequent PR.
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-28 15:06:17 -04:00
Laura Brehm
3ccf4349e7
Merge pull request #9572 from laurazard/dont-wait-for-oneshots
...
Use appropriate dependency condition for one-shot containers when running `compose up --wait`
2022-06-26 14:48:49 +02:00
Laura Brehm
74fd14ec65
Use alpine instead of ubuntu for E2E compose file, no need to include version
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-06-26 14:41:23 +02:00
Abhinav Nair
11f2f2dbc4
Replace deprecated ioutil pkg with os & io
...
As of Go 1.16, the same functionality is now provided by package io or
package os, and those implementations should be preferred in new code.
So replacing all usage of ioutil pkg with io & os.
Signed-off-by: Abhinav Nair <11939846+abhinavnair@users.noreply.github.com>
2022-06-25 14:06:10 +08:00
Guillaume Lours
2cd9c0df5a
Merge pull request #9587 from milas/build-order-classic
...
build: respect dependency order for classic builder
2022-06-24 22:24:22 +02:00
Milas Bowman
ec0efec839
test: add copyright notice
...
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-24 16:16:53 -04:00
Milas Bowman
5f89365c8f
network: make test mock consistent throughout
...
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-22 16:34:59 -04:00
Milas Bowman
b2cd089bae
build: respect dependency order for classic builder
...
When using the "classic" (non-BuildKit) builder, ensure that
services are iterated in dependency order for a build so that
it's possible to guarantee the presence of a base image that's
been added as a dependency with `depends_on`. This is a very
common pattern when using base images with Compose.
A fix for BuildKit is blocked currently until we can rely on a
newer version of the engine (see docker/compose#9324 )[^1].
[^1]: https://github.com/docker/compose/issues/9232#issuecomment-1060389808
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-22 16:24:30 -04:00
Milas Bowman
0f747419b6
networks: prevent issues due to duplicate names
...
Within the Docker API/engine, networks have unique IDs, and the
name is a friendly label/alias, which notably does NOT have any
guarantees around uniqueness (see moby/moby#18864 [^1]).
During day-to-day interactive/CLI Compose usage, this is rarely
an issue, as Compose itself isn't creating networks concurrently
across goroutines. However, if multiple Compose instances are
executed simultaneously (e.g. as part of a test suite that runs
in parallel), this can easily occur.
When it does happen, it's very confusing for users and resolving
it via the `docker` CLI is not straightforward either [^2].
There's two primary changes here:
* Pass `CheckDuplicates: true` to the Docker API when creating
networks to reduce the likelihood of Compose creating duplicates
in the first place
* On `down`, list networks using a name filter and then remove
them all by ID, as the Docker API will return an error if the
name alias is used and maps to more than one network
Hopefully, this provides a better UX, since the issue should be
less likely to occur, and if it does, it can now be resolved via
standard Compose workflow commands.
[^1]: https://github.com/moby/moby/issues/18864
[^2]: https://stackoverflow.com/questions/63776518/error-2-matches-found-based-on-name-network-nameofservice-default-is-ambiguo
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-22 12:27:30 -04:00
Laura Brehm
fd8538f780
Use appropriate dependency condition for one-shot containers when running `compose up --wait`
...
Also add e2e tests to ensure `compose up --wait` does not get stuck forever waiting for one-shot containers
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-06-18 01:20:40 +02:00
Milas Bowman
7f441eb013
e2e: improve test output on failures
...
This is mostly marking a bunch of the run methods as helpers so
that the internal assertions they do will show the line number of
the calling test instead.
There's also some small tweaks around the plugin initialization to
help with the output in the event that it fails to make it easier
to debug what went wrong.
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-16 17:05:43 -04:00
Guillaume Lours
4270987d7c
Merge pull request #9567 from milas/e2e-cmd
...
e2e: ensure all Compose cmds standalone compatible
2022-06-16 23:02:14 +02:00
Milas Bowman
3248b7b335
e2e: use Compose for exec test
...
This was using `docker exec` on Compose containers instead of
`docker compose exec` (and `docker-compose exec` for standalone).
Thanks to @glours for catching!
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-16 16:44:21 -04:00
Milas Bowman
4ea3ba77b2
Merge pull request #9559 from venthur/fix_spell
...
fixed some spelling mistakes
2022-06-16 15:56:44 -04:00
Milas Bowman
9622395c8a
e2e: ensure all Compose cmds standalone compatible
...
The E2E tests can be run in plugin (`docker compose`) or standalone
(`docker-compose`) mode. Existing logic was in place to ensure that
the helper method is always used, which will invoke the right one
based on how tests are being executed.
However, this logic was too easy to (unintentionally) bypass given
the myriad of ways that commands can be run. The check has been
made stricter and pushed to a lower-level to more aggressively
catch instances.
As a result, a bunch of calls to `RunDockerCmd` are now updated
to be `RunDockerComposeCmd`, which will ensure that the invocation
is correct based on test mode.
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-16 15:51:54 -04:00
Guillaume Lours
bec4ea4ab0
Merge pull request #9566 from milas/e2e-ps-stdout
...
e2e: fix spurious `ps` failures
2022-06-16 18:07:22 +02:00
Guillaume Lours
3f10753178
Merge pull request #9563 from milas/e2e-env
...
e2e: isolate test command env from system env
2022-06-16 18:05:39 +02:00
Milas Bowman
152c2d9a33
e2e: fix spurious `ps` failures
...
Use the command `stdout` instead of combined `stdout` + `stderr`
for assertions to avoid failures from any CLI logging such as
warnings, which will be on `stderr`.
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-16 11:28:29 -04:00
Milas Bowman
a261682ca8
e2e: fix per-command env overrides
...
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-16 11:27:39 -04:00
Milas Bowman
ccd87311e8
e2e: always set HOME + USER for cmd env
...
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-16 09:44:40 -04:00
Nick Sieger
49fb4ca25f
down: fix COMPOSE_REMOVE_ORPHANS env name and add test
...
Fixes #9562 .
Signed-off-by: Nick Sieger <nick@nicksieger.com>
2022-06-16 08:40:40 -05:00
Milas Bowman
3ae6c52e8a
e2e: add extra tools needed for ddev test
...
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-16 09:38:25 -04:00
Milas Bowman
1c41df8f56
e2e: robustness changes for ddev test
...
The most important change here is to ensure that the correct Compose
standalone binary is used by `ddev`. Since it invokes Compose itself,
we need to ensure that `PATH` is set appropriately such that it finds
the binary we want to test rather than something from the system.
As part of this, the rest of the environment has been isolated, which
should make the test more reliable, and avoids polluting `~/.ddev`
with test artifacts by using a tmpdir as `HOME` for the test instead
of the user's real home folder.
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-16 08:59:02 -04:00
Milas Bowman
ea8341865d
e2e: isolate test command env from system env
...
When running Docker / Compose commands, do NOT inherit the system
environment to ensure that the tests are reproducible regardless
of host settings.
Additionally, per-command environment overrides are provided to
the command instead of using `os.SetEnv`, as this is not safe when
running tests in parallel (`testing.T::SetEnv` will actually error
if used in this way!)
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-16 08:30:57 -04:00
Milas Bowman
d9065050fd
e2e: fix subtests and block parallel unsafe tests
...
The big mechanical change here is to NOT store `t` as a field on
the `CLI` object (which has been renamed as well to fix the odd
capitalization). The way the tests are structured meant that the
"subtests" were using the _parent_ `*testing.T` instance, which
causes various oddities including confusing messages on failure
about a child test causing a panic in the parent.
Additionally, a few tests have been blocked from running in
parallel because they are sharing `compose.yaml` fixtures and
can fail as a result (e.g. due to a port conflict on the host).
I'll fix these in follow-up PRs but want to focus on correctness
for the tests before optimizing them.
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-15 16:27:30 -04:00
Nicolas De Loof
005fc25823
add support for setting secret from env variable
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-06-15 17:06:48 +02:00
Bastian Venthur
8a5d555de7
fixed some spelling mistakes
...
that's all :)
Signed-off-by: Bastian Venthur <venthur@debian.org>
2022-06-14 21:33:36 +02:00
Nick Sieger
a48f1e8c13
Merge pull request #9547 from docker/nicksieger/e2e-ps-unmarshal
...
e2e: unmarshal json into container summaries
2022-06-14 10:33:53 -05:00
Guillaume Lours
57975094cc
Merge pull request #9552 from glours/fix-deploy-cpus-issue
...
Fix deploy cpus issue and support pids limit
2022-06-14 11:41:35 +02:00
Laura Brehm
80b7a8d274
Only start direct dependencies of service on `compose run ...`
...
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-06-14 07:32:15 +02:00
Guillaume Lours
e111b651b3
add deploy.resourses.limits.pids to the managed resources
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-06-13 17:21:48 +02:00
Guillaume Lours
638d78516a
parse deploy.resources.limit.cpus as float before converting
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-06-13 17:21:48 +02:00
Guillaume Lours
8862f95858
Merge pull request #9514 from ulyssessouza/fix-bindmounts
...
Fix bind mounts when in project volumes definition
2022-06-09 11:15:24 +02:00
Nick Sieger
ebb45b400c
e2e: unmarshal json into container summaries
...
Signed-off-by: Nick Sieger <nick@nicksieger.com>
2022-06-08 15:13:31 -05:00
Nick Sieger
c83133f73b
e2e: add test for ps
...
Signed-off-by: Nick Sieger <nick@nicksieger.com>
2022-06-08 14:05:20 -05:00
Nick Sieger
3599fc8533
mocks: create mocks for compose api.Service
...
Signed-off-by: Nick Sieger <nick@nicksieger.com>
2022-06-07 17:09:06 -05:00
Ulysses Souza
919f351b4b
Fix bind mounts when in project volumes definition
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-06-02 16:37:24 +02:00
Guillaume Lours
d5528f3a54
Merge pull request #9520 from milas/bugfix-network-ambiguity
...
fix: prevent network name ambiguity
2022-06-02 12:44:12 +02:00
Laura Brehm
81182fca53
Add links to container create request.
...
In v1, links were sent alongside the rest of the container create request, as part of `HostConfig`. In v2, links are usually set on the connect container to network request that happens after the create. However, this only happens if the service has one or more networks defined for it. If the services are configured to use the default bridge network, this request is not made and so links are never configured.
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-06-02 02:51:25 +02:00
Milas Bowman
7f32f02817
fix: prevent network name ambiguity
...
`NetworkInspect` will match a network ID by prefix. While rare,
it's possible that users might use a network name that is also
a valid network ID prefix for a pre-existing Docker network.
(In the reported case, the network was named `db`, for example.)
Fixes #9496 .
Signed-off-by: Milas Bowman <milas@tilt.dev>
2022-06-01 15:28:42 -04:00
Guillaume Lours
335decceda
Merge pull request #9504 from docker/nicksieger/9427
...
fix: bring up services with deps with --no-deps
2022-05-31 23:39:19 +02:00
Nick Sieger
28c0fbfdc0
e2e: reproduce bug with links
...
Signed-off-by: Nick Sieger <nick@nicksieger.com>
2022-05-31 16:32:29 -05:00
Nick Sieger
cacff89cef
fix: bring up services with deps with --no-deps
...
Don't fail on not finding dependent services because they were put in the
disabled slice.
Fixes #9427 .
Signed-off-by: Nick Sieger <nick@nicksieger.com>
2022-05-31 16:19:21 -05:00
Guillaume Lours
a1b3f95709
add e2e tests to verify env variables priority
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-05-30 17:11:49 +02:00
Guillaume Lours
e806acce88
Merge pull request #9481 from glours/add-tags-to-build
...
add tags property to build section
2022-05-23 10:23:40 +02:00
Guillaume Lours
285a9c94f7
Merge pull request #9476 from maxcleme/9469-fix-flickering-prompt
...
fix: prevent flickering prompt when pulling same image from N services
2022-05-20 22:09:02 +02:00
Ulysses Souza
b961d49859
Merge pull request #9033 from ulyssessouza/add-e2e-ddev
...
Add ddev's e2e test
2022-05-20 20:02:58 +02:00
Guillaume Lours
9cae9eb0fe
Merge pull request #9488 from ndeloof/attach_profiles
...
attach _only_ to services declared by project applying profiles
2022-05-20 14:38:08 +02:00
Nicolas De Loof
8d03e29994
attach _only_ to services declared by project applying profiles
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-05-20 10:36:06 +02:00
Guillaume Lours
7ee7becd01
fix TestLocalComposeUp which fail locally
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-05-20 07:36:34 +02:00
Randy Fay
97d46a14ef
Fix problems with ddev e2e test and minor cleanup, add tmate ( #27 )
...
* Add tmate for debugging
* Use -parallel=1 for standaone tests
Signed-off-by: Randy Fay <randy@randyfay.com>
2022-05-19 14:14:03 +02:00
Ulysses Souza
a5a1c5f2f1
Add ddev's e2e test
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-05-19 14:14:03 +02:00
Guillaume Lours
a2770b66ff
add tags property to build section
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-05-18 14:43:54 +02:00
Maxime CLEMENT
48b150beff
fix: prevent flickering prompt when pulling same image from N services
...
Signed-off-by: Maxime CLEMENT <maxime.clement@docker.com>
2022-05-18 08:58:06 +02:00
Nicolas De Loof
65b827d08f
bump compose-go to 1.2.5
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-05-17 17:11:32 +02:00
Guillaume Lours
a603e27117
cp command from service to host: use the first container found to copy source on the host
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-05-10 10:50:40 +02:00
Guillaume Lours
a964d5587b
align cp command index management with exec command
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-05-10 10:50:40 +02:00
Guillaume Lours
a983cf551d
cp command: copy to all containers of a service as default behaviour
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-05-10 10:50:40 +02:00
Nicolas De Loof
78b06764a1
compose down exit=0 if nothing to remove
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-05-04 13:51:21 +02:00
Eric Fan
41b3967cb5
Fix cannot setup IPAM gateway
...
Signed-off-by: Eric Fan <ericfan@qnap.com>
2022-04-24 17:30:27 +02:00
Nicolas De Loof
00fd1c1530
inspect image ID after pull to se com.docker.compose.image
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-04-21 22:42:29 +02:00
Nicolas De Loof
0dffd5ba9f
add support for build.secrets
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-04-13 22:45:53 +02:00
Nicolas De Loof
e01687430e
when using `bind` API, use compose-go to (re)build volume string
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-04-13 22:45:53 +02:00
Nicolas De Loof
9668f600d1
project name MUST be lowercase
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-04-13 09:49:01 +02:00
Nicolas De Loof
672e2367fb
don't ignore error
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-04-12 16:00:36 +02:00
Nicolas De Loof
625a48dcf7
`pull` to respect pull_policy
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-04-12 07:59:58 +02:00
Nicolas De Loof
500555b834
linter
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-04-08 11:41:46 +02:00
Nicolas De Loof
e766352d81
include services declared by `links` as implicit dependencies
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-04-08 10:32:36 +02:00
Nicolas De Loof
db698562a9
use project we just created to start services
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-04-07 13:38:30 +02:00
Guillaume Lours
7fea9f7e8b
use project instead of DownOptions.project to list service images in pkg.compose.down
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-04-05 08:24:25 +02:00
Nicolas De Loof
c9fbb9ba9c
inspect container before attachment to use the adequate logic regarding TTY
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-04-04 14:39:38 +02:00
Guillaume Lours
f2d9acd3d4
use ssh config when building from compose up
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-04-04 10:16:28 +02:00
Guillaume Lours
fcff36fc8a
now we use directly the Docker CLI to run autoremove flag should be pass as is
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-04-02 08:45:51 +02:00
Ulysses Souza
56e48f8360
Fix down command without any resource to delete
...
A command down without any resource to delete was
trying to remove a default network that doesn't exist
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-03-31 18:30:29 +02:00
Guillaume Lours
934b596e00
add e2e tests to check usage of ssh build property
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-03-31 12:47:15 +02:00
Guillaume Lours
ff73827a6f
Add support of ssh authentications defined in compose file or via cli flags
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-03-31 12:47:15 +02:00
Guillaume Lours
9b02add4df
fix race condition on start-stop e2e tests running in parrallel
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-03-31 11:16:18 +02:00
Nicolas De Loof
890b6808a2
support cache_from|to|no|pull
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-28 09:36:24 +02:00
Nicolas De Loof
c843d373de
restore TTY auto-detection using dockerCli.Out.IsTerminal
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-16 16:34:26 +01:00
Nicolas De Loof
1d4b4e3c8e
use docker/cli RunExec and RunStart to handle all the interactive/tty/* terminal logic
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-16 16:34:26 +01:00
Guillaume Lours
d999c230a5
Merge pull request #9281 from ndeloof/down_volume_external
...
don't remove external volumes/networks
2022-03-14 17:21:04 +01:00
Nicolas De Loof
e7f545907b
don't remove external volumes/networks
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-14 15:24:49 +01:00
Guillaume Lours
730609b359
Merge pull request #9280 from ndeloof/kill
...
kill only need project name
2022-03-14 10:33:21 +01:00
Nicolas De Loof
cd8074d501
kill only need project name
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-14 10:26:36 +01:00
Nicolas De Loof
283f7a1ec5
Bump buildx to v0.8.0
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-11 14:05:55 +01:00
Nicolas De Loof
85a4d04096
recreate container after image has been rebuilt/pulled
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-10 11:02:48 +01:00
Nicolas De Loof
5e8040ea18
don't fail trying to remove container with no candidate
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-09 16:24:16 +01:00
Guillaume Lours
7036cda306
Merge pull request #9198 from ndeloof/dockerCli_stdout
...
composeService to use dockerCli's In/Out/Err streams
2022-03-09 14:36:07 +01:00
Guillaume Lours
540ad83a6d
Merge pull request #9251 from ndeloof/device_cgroup_rules
...
add support for device_cgroup_rules
2022-03-09 13:27:53 +01:00
Guillaume Lours
a97576e844
add run with dependencies e2e test
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-03-09 12:22:38 +01:00
Nicolas De Loof
d8775c7a28
add support for device_cgroup_rules
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-09 11:39:20 +01:00
Nicolas De Loof
158b5ff6a3
build full compose model from resources, then filter by services
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-09 11:29:30 +01:00
Nicolas De Loof
57e8e8ef29
use plain text progress when ansi=never is set
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-08 15:05:37 +01:00
Nicolas De Loof
8c7951465e
filter containers after project has been rebuilt from resources
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-08 09:47:22 +01:00
Nicolas De Loof
22b8c731c7
prevent getCanonicalContainerName to crash
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-07 14:58:39 +01:00
Guillaume Lours
0ef4b90fae
don't failed when trying to stop or rm services with no containers running
...
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-03-07 10:35:22 +01:00
Nicolas De Loof
dbe7de50a7
don't try to start dependencies when there are none
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-07 08:25:05 +01:00
PIG208
bcaa908f74
Support COMPOSE_IGNORE_ORPHANS for compose run
...
This revives #7020 and resolves the issue mentioned in #4992 .
Signed-off-by: Zixuan James Li <359101898@qq.com>
2022-03-05 22:54:16 +01:00
Vedant Koditkar
e24d274bbc
Fix breaking TestComposePull test case
...
Signed-off-by: Vedant Koditkar <vedant.koditkar@outlook.com>
2022-03-05 23:46:08 +05:30
Vedant Koditkar
89dfb9140e
Merge branch 'v2' into 8768-avoid-pulling-same-image-multiple-times
2022-03-05 21:53:55 +05:30
Ulysses Souza
67b4669f9b
Add function to convert strings to bool
...
Typically used on boolean environment variable values
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-03-04 16:42:37 +01:00
Nicolas De Loof
f86f252a66
composeService to use dockerCli's In/Out/Err streams
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-03 16:34:57 +01:00
Nicolas De Loof
52eeda9aa7
report external volume name not found
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-03-02 08:09:31 +01:00