Commit Graph

438 Commits

Author SHA1 Message Date
Nicolas De Loof 19cbbdd79e
only build requested services
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-08-26 15:55:19 +02:00
Nicolas De Loof 8d476eee4c
apply filter before formatter
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-08-06 15:31:50 +02:00
Hironao OTSUBO 1a0efdd413 Fix issue `docker compose rm -s` not removing containers
Signed-off-by: Hironao OTSUBO <motemen@gmail.com>
2021-07-29 23:37:48 +09:00
Nicolas De loof 3d83989f5d
Merge pull request #1773 from ulyssessouza/completion 2021-07-26 08:23:13 +02:00
Milas Bowman 1e35245390 Print services in dependency order
Currently, `compose config --services` outputs the services in
a random/non-deterministic order.

In Compose v1, this was implicitly topologically sorted because
the project services were pre-sorted. With `compose-go`, the
services are unordered, and the `WithServices()` helper can be
used to iterate in dependency order.

Signed-off-by: Milas Bowman <milasb@gmail.com>
2021-07-21 11:11:38 -04:00
Ulysses Souza c28aec2308 Filter completions by toComplete variable
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-07-12 14:33:37 -03:00
Ulysses Souza 72b66fb5c1 Add 'no completion' or 'service' completion
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-07-12 14:33:37 -03:00
Ulysses Souza 37961c51ca Add completion to "compose ps"
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-07-12 14:33:37 -03:00
Ulysses Souza 3174f49dc2 Add completion to shells
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-07-12 14:33:37 -03:00
Lorena Rangel 8fd04195be
Merge pull request #1914 from ndeloof/run_volumes
run -v should not remove configured volumes
2021-07-12 16:02:21 +02:00
Nicolas De Loof e6f7c64eb8
run -v should not remove configured volumes
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-07-12 12:40:37 +02:00
Nicolas De Loof bf0b75cee0
report error on `ps` when no container found for service(s)
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-07-12 10:42:31 +02:00
Sebastiaan van Stijn a0db32043e
Do not strip "v" prefix from version when printing
I noticed this when building the binary; `internal.Version` is set to `v2.0.0-beta.4`,
to match the tag.

```bash
GIT_TAG=v2.0.0-beta.4
make COMPOSE_BINARY=bin/docker-compose -f builder.Makefile compose-plugin \
    GOOS=linux \
    GOARCH=amd64 \
    CGO_ENABLED=0 \
    go build \
        -trimpath \
        -ldflags="-s -w -X github.com/docker/compose-cli/internal.Version=v2.0.0-beta.4" \
        -o bin/docker-compose \
        ./cmd
```

However, the binary has the `v` prefix stripped (which caused a check to fail
when packaging):

```bash
/root/rpmbuild/BUILDROOT/docker-compose-plugin-2.0.0.beta.4-0.fc34.x86_64/usr/libexec/docker/cli-plugins/docker-compose docker-cli-plugin-metadata
++ awk '{ gsub(/[",:]/,"")}; $1 == "Version" { print $2 }'
+ ver=2.0.0-beta.4
+ test 2.0.0-beta.4 = v2.0.0-beta.4
FAIL: docker-compose version (2.0.0-beta.4) did not match
```

This also looks inconsistent with other binaries and plugins we ship:

```bash
docker info --format '{{json .ClientInfo.Plugins}}' | jq .
[
  {
    "SchemaVersion": "0.1.0",
    "Vendor": "Docker Inc.",
    "Version": "v0.5.1-docker",
    "ShortDescription": "Build with BuildKit",
    "Name": "buildx",
    "Path": "/usr/libexec/docker/cli-plugins/docker-buildx"
  },
  {
    "SchemaVersion": "0.1.0",
    "Vendor": "Docker Inc.",
    "Version": "2.0.0-beta.4",
    "ShortDescription": "Docker Compose",
    "Name": "compose",
    "Path": "/usr/libexec/docker/cli-plugins/docker-compose"
  },
  {
    "SchemaVersion": "0.1.0",
    "Vendor": "Docker Inc.",
    "Version": "v0.8.0",
    "ShortDescription": "Docker Scan",
    "Name": "scan",
    "Path": "/usr/libexec/docker/cli-plugins/docker-scan"
  }
]
```

Perhaps there was a specific reason for this, but thought I'd open this PR for
discussion (if the v-prefix should not be there, perhaps we should isntead strip
it when setting the version).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-03 15:53:21 +02:00
Nicolas De Loof 96e1e041d6
distinguish stdout and stderr
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-07-02 10:53:11 +02:00
Nicolas De Loof b5827d4a86
pass --force and --volumes options to backend
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-06-25 13:46:34 +02:00
Nicolas De Loof d8d739307e test
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-06-24 10:11:01 +02:00
Nicolas De Loof 05b510a447
compose ps to include container command
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-06-22 16:09:47 +02:00
Nicolas De loof 13b57023d7
Merge pull request #1823 from ndeloof/filter_status
implement ps --status=xx filter
2021-06-22 13:32:57 +02:00
Nicolas De Loof 46a65b8c77
add --verbose option for compatibility
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-06-22 11:49:54 +02:00
Nicolas De Loof 3e4f030d2d
implement ps --status=xx filter
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-06-21 11:16:09 +02:00
Afshin Paydar df6d709aa5 Merge branch 'main' of github.com:docker/compose-cli into docker_compose_logs_since_option 2021-06-16 08:57:02 +08:00
Nicolas De Loof 49e7f2d45d Move compose v2 implementation under pkg/compose with dependencies
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-06-15 15:52:48 +02:00
Nicolas De Loof e2ea24ceb7 move compose-plugin commands under /cmd
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-06-15 15:52:48 +02:00
Djordje Lukic 3bb4fe163c Add `docker context create` command
This creates a context with a name and a type
2020-04-26 19:42:20 +02:00
Djordje Lukic 244adb77a4
Merge pull request #20 from chris-crone/copyright
Update copyright date
2020-04-24 18:06:14 +02:00
Christopher Crone d166ad82f9 Update copyright date
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-04-24 14:39:49 +02:00
Ulysses Souza b44547c71f Refactor NewContext
This renames NewContext to NewSigContext and
moves it to ./util/util.go avoiding the servers
to import "github.com/docker/api/client"

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-04-24 11:50:30 +02:00
Djordje Lukic 29a838ddf5
Merge pull request #15 from glours/find_existing_docker_binary
Use docker binary find in path to fallback to Moby CLI
2020-04-23 11:32:13 +02:00
Guillaume Lours 8db55e8c5c Use v2 of urfave/cli
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2020-04-23 09:43:53 +02:00
Guillaume Lours 8af8924a58 Use docker binary find in path to fallback to Moby CLI
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2020-04-22 23:47:04 +02:00
Djordje Lukic 6bfeda054b Go mods initialized, protos without gogo 2020-04-21 15:07:41 +02:00
Djordje Lukic 4b2c8ae9cf Call original docker on moby context
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2020-04-20 21:16:03 +02:00
Guillaume Lours f5aa9638af Add default shellout to engine if no context specified
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2020-04-20 17:16:37 +02:00
Guillaume Lours a8403241e4 Add default shellout to engine if no context specified
Improve CLI documentation

Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2020-04-20 16:22:15 +02:00
Nicolas De Loof 3dac4df803 Implement context loading
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-20 16:22:15 +02:00
Djordje Lukic dfa8e03860 Configure client connection backoff
For faster startup times (from 2s to ~130ms)
2020-04-17 14:37:54 +02:00
Guillaume Tardif 91951eb03a Rename context to example to make it more explicit, context will be a local command managing contexts (similar to docker-cli context command, adapted here for more generic purpose) 2020-04-07 21:36:25 +02:00
Michael Crosby 37591c714b Add base cli and connection logic
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2020-04-06 11:54:01 -04:00