e98e95e7bc
Port mappings in `docker service ls` are quite verbose, and occupy a lot of space when ranges of ports are published. This patch improves the output by reconstructing ranges of ports. Given the following service; $ docker service create \ -p 60-61:60-61 \ -p 62:61 \ -p 80:80 \ -p 81:80 \ -p 90-95:90-95 \ -p 90-92:90-92/udp \ -p 93-96:93-96/udp \ --name foo \ nginx:alpine Before this patch is applied: $ docker service ls ID NAME MODE REPLICAS IMAGE PORTS u1kwguv841qg foo replicated 1/1 nginx:alpine *:60->60/tcp,*:61->61/tcp,*:62->61/tcp,*:80->80/tcp,*:81->80/tcp,*:90->90/tcp,*:91->91/tcp,*:92->92/tcp,*:93->93/tcp,*:94->94/tcp,*:95->95/tcp,*:90->90/udp,*:91->91/udp,*:92->92/udp,*:93->93/udp,*:94->94/udp,*:95->95/udp,*:96->96/udp After this patch is applied: $ docker service ls ID NAME MODE REPLICAS IMAGE PORTS u1kwguv841qg foo replicated 1/1 nginx:alpine *:60-62->60-61/tcp,*:80-81->80/tcp,*:90-95->90-95/tcp,*:90-96->90-96/udp Additional enhancements can still be made, and marked as TODO in this change; - combine non-consecutive ports mapped to a single port (`80->80`, `81->80`, `84->80`, `86->80`, `87->80`); to be printed as `*:80-81,84,86-87->80`. - combine `tcp` and `udp` mappings if their port-mapping is the same; print `*:80-81->80-81/tcp+udp` instead of `*:80-81->80-81/tcp, *:80-81->80-81/udp` Signed-off-by: Sebastiaan van Stijn <github@gone.nl> |
||
---|---|---|
.github | ||
cli | ||
cmd/docker | ||
contrib/completion | ||
dockerfiles | ||
docs | ||
e2e | ||
experimental | ||
internal/test | ||
man | ||
opts | ||
scripts | ||
service/logs | ||
templates | ||
vendor | ||
.dockerignore | ||
.gitignore | ||
CONTRIBUTING.md | ||
Jenkinsfile | ||
LICENSE | ||
MAINTAINERS | ||
Makefile | ||
NOTICE | ||
README.md | ||
TESTING.md | ||
VERSION | ||
circle.yml | ||
codecov.yml | ||
docker.Makefile | ||
gometalinter.json | ||
poule.yml | ||
vendor.conf |
README.md
docker/cli
This repository is the home of the cli used in the Docker CE and Docker EE products.
Development
docker/cli
is developed using Docker.
Build a linux binary:
$ make -f docker.Makefile binary
Build binaries for all supported platforms:
$ make -f docker.Makefile cross
Run all linting:
$ make -f docker.Makefile lint
List all the available targets:
$ make help
In-container development environment
Start an interactive development environment:
$ make -f docker.Makefile shell
In the development environment you can run many tasks, including build binaries:
$ make binary
Legal
Brought to you courtesy of our legal counsel. For more context, please see the NOTICE document in this repo.
Use and transfer of Docker may be subject to certain restrictions by the United States and other governments.
It is your responsibility to ensure that your use and/or transfer does not violate applicable laws.
For more information, please see https://www.bis.doc.gov
Licensing
docker/cli is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.