Nav apraksta

Chris Crone 59eaa8e93b readme: Prep for open source 5 gadi atpakaļ
.github ae45e08d43 Remove dependabot and add a check-dependencies command in make file 5 gadi atpakaļ
aci 4c6280b0e9 Rename docker/api -> docker/compose-cli 5 gadi atpakaļ
backend 4c6280b0e9 Rename docker/api -> docker/compose-cli 5 gadi atpakaļ
cli ad5c465bd1 Merge pull request #485 from docker/repo-rename 5 gadi atpakaļ
client 4c6280b0e9 Rename docker/api -> docker/compose-cli 5 gadi atpakaļ
compose ec4615ae57 Apply linter recommendations 5 gadi atpakaļ
config 4c6280b0e9 Rename docker/api -> docker/compose-cli 5 gadi atpakaļ
containers 4c6280b0e9 Rename docker/api -> docker/compose-cli 5 gadi atpakaļ
context 4c6280b0e9 Rename docker/api -> docker/compose-cli 5 gadi atpakaļ
docs 95de770e87 Update or add license header which are not valid 5 gadi atpakaļ
ecs 4879e88b04 Fix last references to /docker/api 5 gadi atpakaļ
errdefs 8e893fc5eb errdefs: Move to gotest.tools 5 gadi atpakaļ
example 4c6280b0e9 Rename docker/api -> docker/compose-cli 5 gadi atpakaļ
formatter 3ba70a27c6 formatter,multierror,progress: Move to gotest.tools 5 gadi atpakaļ
local ad5c465bd1 Merge pull request #485 from docker/repo-rename 5 gadi atpakaļ
metrics 4c6280b0e9 Rename docker/api -> docker/compose-cli 5 gadi atpakaļ
progress 4c6280b0e9 Rename docker/api -> docker/compose-cli 5 gadi atpakaļ
prompt 95de770e87 Update or add license header which are not valid 5 gadi atpakaļ
protos 4c6280b0e9 Rename docker/api -> docker/compose-cli 5 gadi atpakaļ
scripts b4e45bf597 Add a script to check if go.mod and go.sum are up-to-date 5 gadi atpakaļ
secrets ec4615ae57 Apply linter recommendations 5 gadi atpakaļ
server 4c6280b0e9 Rename docker/api -> docker/compose-cli 5 gadi atpakaļ
tests ad5c465bd1 Merge pull request #485 from docker/repo-rename 5 gadi atpakaļ
utils 95de770e87 Update or add license header which are not valid 5 gadi atpakaļ
.dockerignore 9097b1f750 Add .git to .dockerignore 5 gadi atpakaļ
.gitattributes 93984f8c68 Removed test requiring linux containers 5 gadi atpakaļ
.gitignore fcc7582826 Remove non-project path 5 gadi atpakaļ
.golangci.yml 69f10fe80c Extract interface / types to allow unit tests / mock 5 gadi atpakaļ
CHANGELOG.md 4c6280b0e9 Rename docker/api -> docker/compose-cli 5 gadi atpakaļ
CONTRIBUTING.md 8cfcfc8645 Add issue template, Contributing guide and maintainers list 5 gadi atpakaļ
Dockerfile 4c6280b0e9 Rename docker/api -> docker/compose-cli 5 gadi atpakaļ
LICENSE d7d9bb28bb Add LICENSE and NOTICE files 5 gadi atpakaļ
MAINTAINERS 8cfcfc8645 Add issue template, Contributing guide and maintainers list 5 gadi atpakaļ
Makefile ae45e08d43 Remove dependabot and add a check-dependencies command in make file 5 gadi atpakaļ
NOTICE d7d9bb28bb Add LICENSE and NOTICE files 5 gadi atpakaļ
README.md 59eaa8e93b readme: Prep for open source 5 gadi atpakaļ
builder.Makefile b41d216aaa Add import restrictions check 5 gadi atpakaļ
go.mod ad5c465bd1 Merge pull request #485 from docker/repo-rename 5 gadi atpakaļ
go.sum a15679fb94 Update go.sum after dependabot PR 5 gadi atpakaļ
import-restrictions.yaml 4c6280b0e9 Rename docker/api -> docker/compose-cli 5 gadi atpakaļ

README.md

Docker Compose CLI

Actions Status

This CLI tool makes it easy to run containers in the cloud using either Amazon Elastic Container Service (ECS) or Microsoft Azure Container Instances (ACI) using the Docker commands you already know.

To get started, all you need is:

:warning: This CLI is currently in beta please create issues to leave feedback

Examples

Developing

Prerequisites

Building the CLI

Once you have the prerequisites installed, you can build the CLI using:

make

This will output a CLI for your host machine in ./bin.

You will then need to make sure that you have the existing Docker CLI in your PATH with the name com.docker.cli. A make target is provided to help with this:

make moby-cli-link

This will create a symbolic link from the existing Docker CLI to /usr/local/bin with the name com.docker.cli.

You can statically cross compile the CLI for Windows, macOS, and Linux using the cross target.

Building with specific backends

You can specify which backends are build using the BUILD_TAGS variable. The available backends are:

  • aci: For ACI support (always built)
  • ecs: For ECS support (on by default)
  • example: Testing backend (off by default)
  • local: Beginnings of a moby backend (off by default)

If you want the ACI, ECS and example backends, then you can build as follows:

make BUILD_TAGS=example cli

Updating the API code

The API provided by the CLI is defined using protobuf. If you make changes to the .proto files in protos/, you will need to regenerate the API code:

make protos

Unit tests

To run all of the unit tests, run:

make test

If you need to update a golden file simply do go test ./... -test.update-golden.

End to end tests

Local tests

To run the local end to end tests, run:

make e2e-local

Note that this requires the CLI to be built and a local Docker Engine to be running.

ACI tests

To run the end to end ACI tests, you will first need to have an Azure account and have created a service principal. You can create a service principle using the Azure CLI after you have done a docker login azure:

$ docker login azure
$ az ad sp create-for-rbac --name 'MyTestServicePrincipal' --sdk-auth

You can then run the ACI tests using the e2e-aci target with the various AZURE_ environment variables set:

AZURE_TENANT_ID="xxx" AZURE_CLIENT_ID="yyy" AZURE_CLIENT_SECRET="yyy" make e2e-aci

Running the ACI tests will override your local login and the service principal credentials use a token that cannot be refreshed automatically.

Note: You will need to rerun docker login azure if you would like to use the CLI after running the ACI tests.

You can also run a single ACI test by specifying the test name with the E2E_TEST variable:

AZURE_TENANT_ID="xxx" AZURE_CLIENT_ID="yyy" AZURE_CLIENT_SECRET="yyy" make E2E_TEST=TestContainerRun e2e-aci

ECS tests

To run the end to end ECS tests, you will need to have an AWS account and have credentials for it in the ~/.aws/credentials file.

You can then use the e2e-ecs target:

TEST_AWS_PROFILE=myProfile TEST_AWS_REGION=eu-west-3 make e2e-ecs

Releases

To create a new release:

  • Check that the CI is green on the main branch for commit you want to release
  • Create a new tag of the form vx.y.z, following existing tags, and push the tag

Pushing the tag will automatically create a new release and make binaries for Windows, macOS, and Linux available for download on the releases page.