Guillaume Lours
3c25af4fe9
Merge pull request #11405 from ndeloof/issue_11392
...
Fix load .env from project directory when project file is set by COMPOSE_FILE
2024-01-31 10:52:28 +01:00
Milas Bowman
8fdd45cd4c
chore(e2e): fix flaky test & standalone behavior ( #11382 )
2024-01-30 10:49:53 -05:00
jhrotko
0582001810
Fix canonical container name
...
Signed-off-by: jhrotko <joana.hrotko@docker.com>
2024-01-30 15:12:22 +01:00
Nicolas De Loof
da1a34a8f2
don't check external network existence when swarm is enabled
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-01-29 20:00:29 +01:00
Nicolas De Loof
7e991515bc
Add support for storage_opt
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-01-29 19:24:23 +01:00
Nicolas De Loof
a8bd3b7af1
Fix load .env from project directory when project file is set by COMPOSE_FILE
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-01-25 09:26:22 +01:00
Nicolas De Loof
1551fcb4e6
introduce stopAndRemoveContainer to share logic scaling down
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-01-23 14:16:13 +01:00
Nicolas De Loof
eb4249ece4
bump compose-go to v2.0.0-rc.2
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-01-22 12:27:38 +01:00
Nicolas De Loof
f414bf7892
fix engine version require to use healthcheck.start_interval
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-01-17 10:45:01 +01:00
Nicolas De Loof
3c4593f2ad
Stop the resource timer after last expected event
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-01-16 22:18:42 +01:00
Guillaume Lours
8b16ab1040
Merge pull request #11307 from glours/compose-go-immutable-projects
...
update compose-go to version using immutable Project functions
2024-01-11 14:11:12 +01:00
Guillaume Lours
24d34040e3
Merge pull request #11181 from g0t4/11153-compose-attach-override-container-attach-cmd
...
Implement `docker compose attach`
2024-01-11 11:11:10 +01:00
Guillaume Lours
5d05df6e5c
update compose-go to version using immutable Project functions
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-01-11 10:44:42 +01:00
Brian Goff
2bf2b22fbe
Add source policies for build
...
Build{x,kit} support passing in source policies via an (expirimental)
env var.
This change adds those policies to the build request.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2024-01-10 11:41:03 +01:00
Nicolas De Loof
575f2ed7f2
watch: remove requirements for tar binary and for sync target to be rw
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-01-09 15:43:34 +01:00
Wes Higbee
dcf6bd779f
make mocks
...
Signed-off-by: Wes Higbee <wes.mcclure@gmail.com>
2024-01-08 17:15:11 -06:00
Wes Higbee
80823b77ef
go ahead and wire up sig-proxy and no-stdin for consistency with underlying docker container attach
...
Signed-off-by: Wes Higbee <wes.mcclure@gmail.com>
2024-01-08 17:15:11 -06:00
Wes Higbee
2c16e16db7
docker compose attach via RunAttach (from docker/cli's docker container attach)
...
Signed-off-by: Wes Higbee <wes.mcclure@gmail.com>
2024-01-08 17:14:49 -06:00
Guillaume Lours
f659918743
Merge pull request #11298 from ndeloof/proxy
...
remove ServiceProxy which was introduced for archived compose-cli
2024-01-08 10:04:00 +01:00
Laura Brehm
dcbf005fe4
up: gracefully teardown when command ctx cancelled
...
Previously, if a long-lived plugin process (such as
an execution of `compose up`) was running and then
detached from a terminal, signalling the parent CLI
process to exit would leave the plugin process behind.
To address this, changes were introduced on the CLI side
(see: https://github.com/docker/cli/pull/4599 ) to enable
the CLI to notify a running plugin process that it should
exit. This makes it so that, when the parent CLI process
is going to exit, the command context of the plugin
command being executed is cancelled.
This commit takes advantage of these changes by tapping into
the command context's done channel and using it to teardown
on an up.
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-12-23 02:49:27 +00:00
Nicolas De Loof
f58f23a6a2
remove ServiceProxy which was introduced for archived compose-cli
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-22 14:02:21 +01:00
Nicolas De Loof
17da54da20
introduce build --with-dependencies
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-20 15:58:54 +01:00
horus
1baa4f4489
up: fix write/close race condition in logPrinter
...
The code used an atomic bool to guard channel writes. However, this
failed to synchronize with the call to close(), causing a panic.
Fix the race condition by using a mutex to guard the update to the
bool `stopped` and subsequent channel writes. This ensures atomic
execution of both updates to `stopped` and channel writes, preventing
races between writes and close().
Signed-off-by: horus <horus.li@gmail.com>
2023-12-20 15:45:12 +01:00
Laura Brehm
7781b7c992
deps: update docker/cli to fix go version selection issue
...
see: 70216b662d
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-12-19 14:15:16 +00:00
Albin Kerouanton
785835b1a2
Add support for endpoint-specific MAC address
...
Related to:
- https://github.com/compose-spec/compose-spec/pull/435
- https://github.com/moby/moby/pull/45905
Since API v1.44, Moby supports a per-endpoint MAC address and returns a
warning when the container-wide mac_address field is set.
A corresponding field has been added to compose-spec and compose-go, so
we need to leverage it to set the right API field.
This commit is backward-compatible with compose files that still set the
container-wide mac_address field, and older API versions that don't know
about the endpoint-specific MAC address field.
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2023-12-18 12:04:45 +01:00
Nicolas De Loof
74cc091225
github.com/golang/mock is deprecated
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-13 14:47:39 +01:00
Nicolas De Loof
5e61c62ecf
collect services to build using WithServices
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-07 17:05:42 +01:00
Nicolas De Loof
fb3868ffaf
add support for start_interval
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-07 15:59:22 +01:00
Nicolas De Loof
26aca867d8
avoid use of service.Name when iterating on project.Services
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-05 18:54:31 +01:00
Nicolas De Loof
138facea62
project.Services is a map
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-05 18:54:31 +01:00
Nicolas De Loof
cda04f288e
adopt compose-go/v2
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-05 18:54:31 +01:00
Milas Bowman
07df9cc46e
fix typo
...
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2023-12-05 18:08:38 +01:00
Milas Bowman
7c8ff36d78
move around OCI logic, auto fallback/retry 1.1 -> 1.0
...
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2023-12-05 18:08:38 +01:00
Milas Bowman
111ad3b039
fix(publish): add OCI 1.0 fallback support for AWS ECR
...
Currently, we publish Compose artifacts following the OCI 1.1
specification, which is still in the RC state.
As a result, not all registries support it yet. Most notably,
AWS ECR will reject certain OCI 1.1-compliant requests with
`405 Method Not Supported` with cryptic `Invalid JSON` errors.
This adds initial support for Compose to generate either an
OCI 1.0 or OCI 1.1 compatible manifest. Notably, the OCI 1.0
manifest will be missing the `application/vnd.docker.compose.project`
artifact type, as that does not exist in that version of the
spec. (Less importantly, it uses an empty `ImageConfig`
instead of the newer `application/vnd.oci.empty.v1+json` media
type for the config.)
Currently, this is not exposed as an option (via CLI flags or
env vars). By default, OCI 1.1 is used unless the registry
domain is `amazonaws.com`, which indicates an ECR registry, so
Compose will instead use OCI 1.0.
Moving forward, we should decide how much we want to expose/
support different OCI versions and investigate if there's a
more generic way to feature probe the registry to avoid
maintaining a hardcoded list of domains, which is both tedious
and insufficient.
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2023-12-05 18:08:38 +01:00
Nicolas De Loof
8026d0e2f2
adopt container.RestartPolicy*
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-05 17:02:37 +01:00
Nicolas De Loof
df1533a1ca
[lint] don't use deprecated types
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-05 17:02:37 +01:00
Wes Higbee
56e2ad9ee5
update to v1.25 for RunAttach
...
Signed-off-by: Wes Higbee <wes.mcclure@gmail.com>
2023-12-05 17:02:37 +01:00
vyneer
1f148244af
send out a cancel event on SIGINT/SIGTERM
...
Signed-off-by: vyneer <vyn33r@gmail.com>
2023-11-30 09:11:55 +01:00
Nicolas De Loof
59f11ecbeb
Fix configs are mounted under /<id>
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-29 16:53:22 +01:00
Amit Saha
750553c866
introduce compose logs --index to select a replica container
...
Signed-off-by: Amit Saha <asaha@atlassian.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-29 13:56:16 +01:00
Amit Saha
8c964f5ad3
Update E2E test
...
Signed-off-by: Amit Saha <asaha@atlassian.com>
2023-11-29 13:56:16 +01:00
Amit Saha
90ca13b747
Fix E2E test to have index in the correct position
...
Signed-off-by: Amit Saha <asaha@atlassian.com>
2023-11-29 13:56:16 +01:00
Amit Saha
e981c35863
Add failing test
...
Signed-off-by: Amit Saha <asaha@atlassian.com>
2023-11-29 13:56:16 +01:00
Nicolas De Loof
9025d63a63
bump ddev
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-27 14:19:53 +01:00
Nicolas De Loof
a1de0b96c3
Restore `Project` is ps json output
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-24 10:46:33 +01:00
Guillaume Lours
c665c53cc1
bump buildx to v0.12.0 and adapt code to changes
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2023-11-23 07:36:13 +01:00
Nicolas De Loof
b1a26dac1d
Assume /src/pkg/compose/testdata absolute workingdir to make tests reproducible
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-21 16:11:42 +01:00
Nicolas De Loof
5e77ae9247
avoir use of []types.ServiceConfig
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-21 12:08:12 +01:00
Guillaume Lours
f557220140
identify services to build and don't display 'building' if none
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2023-11-21 11:35:11 +01:00
Nicolas De Loof
8e1b32365e
fix --remove-orphans not to consider disabled services as orphaned
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-20 21:35:13 +01:00
Nicolas De Loof
7cb1f8baf2
introduce RuntimeVersion for code to check container runtime supports required features
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-20 11:45:16 +01:00
Nicolas De Loof
cb01186c2b
push also consider build.tags
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-17 16:31:52 +01:00
Ulysses Souza
efea084df6
Merge pull request #11192 from ulyssessouza/exclude-tests-context
2023-11-16 12:25:13 +01:00
Nicolas De Loof
9c4efbdd92
Strip project prefix from docker-compose up output
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-15 21:39:16 +01:00
Ulysses Souza
8ea7c9e0d2
Make it context aware and add test skipping options
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2023-11-15 21:09:50 +01:00
Nicolas De Loof
cf608fa954
bump compose-go to v1.20.1
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-13 22:07:02 +01:00
Nicolas De Loof
426377a4c9
reject compose file using `secrets|configs.driver or template_driver`
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-13 17:26:00 +01:00
Ulysses Souza
493f6c8055
skips flaky e2e tests on watch and attach
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2023-11-10 18:31:25 +01:00
Guillaume Lours
e5cd265abb
improve watch configuration logging
...
Add action associated to each managed path
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2023-11-06 13:48:15 +01:00
Nicolas De Loof
d646d757a2
lint
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-02 11:16:35 +01:00
Nicolas De Loof
71237ef62b
do not resolve cache dir until remote resource is in use
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-02 11:16:35 +01:00
Nicolas De Loof
0d905a896d
add a copyright notice with original author
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-02 11:16:35 +01:00
Nicolas De Loof
5e3d8f671d
re-implement cache folder detection
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-02 11:16:35 +01:00
Nicolas De Loof
6727908803
introduce --resolve-image-digests for publish to seal service images by digest
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-02 10:43:45 +01:00
kimdcottrell
616bba0afd
linter errors fixed
...
Signed-off-by: kimdcottrell <me@kimdcottrell.com>
2023-10-29 22:08:00 +01:00
kimdcottrell
ee6e3c2a44
NetworkList to NetworkInspect for ID search
...
Signed-off-by: kimdcottrell <me@kimdcottrell.com>
2023-10-29 22:08:00 +01:00
kimdcottrell
c7e31a3c15
Squashing feature branch commits in order to add signoff message.
...
- added clarity with error handling. added test to show issue.
- in manual testing, this fixes the issue and allows watch to run after rebuild
- added cleanup back in
- fixed issue where watch extnet rebuild test would start all containers listed in the fixture
Signed-off-by: kimdcottrell <me@kimdcottrell.com>
2023-10-29 22:08:00 +01:00
Nicolas De Loof
dd0803dba1
fix SIGTERM support to stop/kill stack
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-10-26 12:19:50 +02:00
Nicolas De Loof
39008c539c
align with OCI artifact best practices
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-10-23 20:26:13 +02:00
Eng Zer Jun
6c345b3755
refactor(cmd/compose/run): remove redundant `len` check
...
From the Go specification [1]:
"1. For a nil slice, the number of iterations is 0."
`len` returns 0 if the slice is nil [2]. Therefore, checking
`len(v) > 0` before a loop is unnecessary.
[1]: https://go.dev/ref/spec#For_range
[2]: https://pkg.go.dev/builtin#len
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-10-23 16:06:52 +08:00
Guillaume Lours
b8773ad1c5
Merge pull request #11110 from ndeloof/wait_missing
...
fail start if depependency is missing
2023-10-19 10:04:32 +02:00
Nicolas De Loof
1ffa194e12
fail start if depependency is missing
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-10-19 09:50:37 +02:00
Guillaume Lours
5e1d3f2b41
Merge pull request #11051 from ndeloof/warn_remote_disabled
...
warn user remote resource is disabled
2023-10-18 12:54:40 +02:00
Guillaume Lours
3d0207ebc8
remove uncessary return value of pullComposeFiles function
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2023-10-18 12:42:11 +02:00
Guillaume Lours
818bc3c34a
add sync+restart action to watch attribute
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2023-10-18 12:11:02 +02:00
Guillaume Lours
9dd081b92e
add support of COMPOSE_ENV_FILES env variable to pass a list of env files
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2023-10-05 21:55:43 +02:00
Guillaume Lours
2c0b023273
add dry-run support for publish command
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2023-10-05 21:55:00 +02:00
Nicolas De Loof
599e4b242a
extract method to reduce cyclomatic complexity
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-09-29 10:18:11 +02:00
Nicolas De Loof
fe8c2780c8
warn user remote resource is disabled
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-09-29 09:30:38 +02:00
Matthieu MOREL
4f694919ff
deps: remove deprecated github.com/pkg/errors
...
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-09-29 06:28:58 +02:00
Matthew Walowski
6ecab95775
Include image name in error message
...
Signed-off-by: Matthew Walowski <mattwalowski@gmail.com>
2023-09-29 06:25:10 +02:00
Bjorn Neergaard
12e0ac898a
pkg/compose/publish: use empty config descriptor mediaType
...
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-09-29 05:27:14 +02:00
Bjorn Neergaard
a6b7d78575
pkg/remote/oci: check artifactType instead of config.mediaType
...
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-09-29 05:27:14 +02:00
Bjorn Neergaard
991901f2ef
pkg/remote/oci: refer to the manifest as manifest
...
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-09-29 05:27:14 +02:00
Guillaume Lours
2d971fc97d
update the watch warning message when no services with a develop section
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2023-09-27 23:28:45 +02:00
Guillaume Lours
52a641bf6d
Merge pull request #11021 from glours/move-watch-to-main-cmd
...
move watch from alpha to main command
2023-09-21 10:08:23 +02:00
Guillaume Lours
61c8be11c0
remove --timeout=0 flag to cleanup function of watch e2e test
...
compose down command need the watch process to be killed to succeed
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2023-09-20 21:32:03 +02:00
Guillaume Lours
6be5f3003a
move watch from alpha to main command
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2023-09-20 18:55:08 +02:00
Nicolas De Loof
c34c306cb9
TestWatch to use new `develop` section
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-09-20 18:39:32 +02:00
Nicolas De Loof
5ca35c88be
implement publish
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-09-20 18:14:58 +02:00
Nicolas De loof
805541be9d
watch: use official `develop` section ( #11026 )
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-09-20 11:51:53 -04:00
Nicolas De Loof
8af49ff369
resolve service reference into container based on observed state
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-09-14 15:29:50 +02:00
Nicolas De Loof
f6e31dbc6a
don't rely on depends_on to resolve volume_from, better use observed state
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-09-14 15:29:50 +02:00
Guillaume Lours
1a98a70b8a
add scale command
...
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2023-09-13 11:15:14 +02:00
Milas Bowman
19bbb12fac
ci: tweak restricted imports in linter ( #10992 )
...
* Eliminate direct dependency on gopkg.in/yaml.v2
* Add gopkg.in/yaml.v2 as a restricted import
* Add github.com/distribution/distribution as a restricted dependency in favor of distribution/reference which is the subset of functionality that Compose needs
* Remove an unused exclusion
NOTE: This does change the `compose config` output slightly but does NOT change the semantics:
* YAML indentation is slightly different for lists (this is a `v2` / `v3` thing)
* JSON is now "minified" instead of pretty-printed (I think this generally desirable and more consistent with other JSON command outputs)
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2023-09-11 15:53:19 +00:00
Milas Bowman
d7b0b2bd7d
watch: build & launch the project at start ( #10957 )
...
The `alpha watch` command current "attaches" to an already-running
Compose project, so it's necessary to run something like
`docker compose up --wait` first.
Now, we'll do the equivalent of an `up --build` before starting the
watch, so that we know the project is up-to-date and running.
Additionally, unlike an interactive `up`, the services are not stopped
when `watch` exits (e.g. via `Ctrl-C`). This prevents the need to start
from scratch each time the command is run - if some services are already
running and up-to-date, they can be used as-is. A `down` can always be
used to destroy everything, and we can consider introducing a flag like
`--down-on-exit` to `watch` or changing the default.
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2023-09-07 13:27:23 -04:00
Nicolas De Loof
e0f39ebbef
pull OCI remote resource
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-09-07 07:27:32 +02:00
Nicolas De Loof
c9d54f09cf
introduce publish (alpha) command
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-09-07 07:27:32 +02:00
Sebastiaan van Stijn
f4f2e934ac
migrate to github.com/distribution/reference
...
The "reference" package was moved to a separate module, which was extracted
from b9b19409cf
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-04 14:36:36 +02:00
Nicolas De Loof
32c3d0a3ff
Enable service explicitly requested to be restarted
...
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-09-01 12:01:02 +02:00