Commit graph

902 commits

Author SHA1 Message Date
Andrea Luzzardi
89a995a9d7 services: Add support for Credential Spec and SELinux
- Defined "normalized" type for Credential Spec and SELinux
- Added --credential-spec to docker service create & update
- SELinux is API only at the time

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2017-04-07 11:30:54 -07:00
Daniel Nephin
ae27355b09 Add support for volume consistency in compose format.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-04-07 13:23:33 -04:00
Vincent Demeester
8b9d54c084 Merge pull request #32289 from adshmh/add-unit-tests-for-cli-command-secret-package
add unit tests for package cli/command/secret
2017-04-07 15:26:40 +02:00
Arash Deshmeh
603dd8b3b4 use an encrypted client certificate to connect to a docker daemon
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-04-07 01:50:51 -04:00
Drew Erny
1044093bb0 refactor logs and support service logs /w tty
Refactor container logs system to make communicating log messages
internally much simpler. Move responsibility for marshalling log
messages into the REST server. Support TTY logs. Pave the way for fixing
the ambiguous bytestream format. Pave the way for fixing details.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2017-04-06 17:54:11 -07:00
Aaron Lehmann
9b54994a8a Add support for update order
This parameter controls the order of operations when rolling out an
update task. Either the old task is stopped before starting the new one,
or the new task is started first, and the running tasks will briefly
overlap.

This commit adds Rollout to the API, and --update-order / --rollback-order
flags to the CLI.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-06 17:23:36 -07:00
Yong Tang
6102243692 Add --cpus support for docker update
This fix tries to address the issue raised in 31032 where it was
not possible to specify `--cpus` for `docker update`.

This fix adds `--cpus` support for `docker update`. In case both
`--cpus` and `--cpu-period/--cpu-quota` have been specified,
an error will be returned.

Related docs has been updated.

Integration tests have been added.

This fix fixes 31032.

This fix is related to 27921, 27958.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-04-06 15:40:12 -07:00
Brian Goff
30cdabd13f Merge pull request #32407 from dnephin/fix-rw-mode-compose-files
Support rw as a volume option in compose file
2017-04-06 16:24:20 -04:00
Daniel Nephin
8cd6c30a48 Upadte archive.ReplaceFileTarWrapper() to not expect a sorted archive
Improve test coverage of ReplaceFileTarWrapper()

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-04-06 13:36:34 -04:00
Sebastiaan van Stijn
c4010e257f Merge pull request #28938 from elifa/master
Grace period option to health checks.
2017-04-06 19:23:56 +02:00
Yong Tang
7025247324 Add label filter for docker system prune
This fix tries to address the issue raised in 29999 where it was not
possible to mask these items (like important non-removable stuff)
from `docker system prune`.

This fix adds `label` and `label!` field for `--filter` in `system prune`,
so that it is possible to selectively prune items like:
```
$ docker container prune --filter label=foo

$ docker container prune --filter label!=bar
```

Additional unit tests and integration tests have been added.

This fix fixes 29999.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-04-06 09:11:25 -07:00
Daniel Nephin
062830535d Support rw as a volume option in compose file.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-04-06 10:32:35 -04:00
Vincent Demeester
f5d881b835 Merge pull request #32364 from aaronlehmann/preserve-env-order
cli: Preserve order of environment variables
2017-04-06 14:25:29 +02:00
Elias Faxö
e401f63735 Added start period option to health check.
Signed-off-by: Elias Faxö <elias.faxo@gmail.com>
2017-04-06 12:35:34 +02:00
Daniel Nephin
56bf6de9f7 Factor out adding dockerfile from stdin.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-04-05 19:42:31 -04:00
David Sheets
3f6dc81e10 build: accept -f - to read Dockerfile from stdin
Heavily based on implementation by David Sheets

Signed-off-by: David Sheets <sheets@alum.mit.edu>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-04-05 19:42:31 -04:00
Vincent Demeester
945a119c8a Merge pull request #32251 from AkihiroSuda/run-mount
cli: add `--mount` to `docker run`
2017-04-05 22:34:47 +02:00
Arash Deshmeh
ff0899ad2f stack rm should accept multiple arguments
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-04-05 01:08:37 -04:00
Akihiro Suda
77fe35b3b9 cli: add --mount to docker run
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-04-05 04:52:08 +00:00
Aaron Lehmann
b426741c15 cli: Preserve order of environment variables
Unless we are adding or removing environment variables, their order
shouldn't be changed. This makes it look like the service's TaskSpec has
changed relative to the old version of the service, and containers need
to be redeployed.

The existing code always rebuilds the list of environment variables by
converting them to a map and back, but there's no reason to do this if
no environment variables are being added.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-04 18:16:57 -07:00
Yong Tang
7328ae12cc Add hidden placeholder of .Self for docker node ls --format
This commit adds a hidden placeholder of `.Self` for
`docker node ls --format` so that if the node is the same
as the current docker daemon, then a `*` is outputed.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-04-04 12:46:44 -07:00
Arash Deshmeh
243a8e69ff added unit tests for package cli/command/secret
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-04-04 15:35:08 -04:00
Yong Tang
32e21ecbfe Add --format for docker node ls
This fix tries to address the comment https://github.com/docker/docker/pull/30376#discussion_r97465334
where it was not possible to specify `--format` for `docker node ls`. The `--format` flag
is a quite useful flag that could be used in many places such as completion.

This fix implements `--format` for `docker node ls` and add `nodesFormat` in config.json
so that it is possible to specify the output when `docker node ls` is invoked.

Related documentations have been updated.

A set of unit tests have been added.

This fix is related to #30376.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-04-04 11:26:35 -07:00
Sebastiaan van Stijn
fe4d7db1ec Merge pull request #30813 from yongtang/30232-service-ls-ports
Add `PORTS` field for `docker service ls` (`ingress`)
2017-04-04 17:04:27 +02:00
Vincent Demeester
93ffbb76c3 Merge pull request #32333 from dnephin/fix-endpoint-mode
Fix endpoint mode loading from Compose file in stack deploy
2017-04-04 14:12:26 +02:00
Victor Vieux
170be9c267 Merge pull request #32015 from dperny/service-logs-support-task-logs
Add Support for Service Task Logs
2017-04-04 00:15:13 -07:00
Drew Erny
d330dc3223 Add support for task and arbitrary combo logs
Refactored the API to more easily accept new endpoints. Added REST,
client, and CLI endpoints for getting logs from a specific task. All
that is needed after this commit to enable arbitrary service log
selectors is a REST endpoint and handler.

Task logs can be retrieved by putting in a task ID at the CLI instead of
a service ID.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2017-04-03 18:40:54 -07:00
Yong Tang
c877c7b2bf Add PORTS field for docker service ls (ingress)
This fix is related to 30232 wherw `docker service ls`
does not show `PORTS` information like `docker service ps`.

This fix adds `PORTS` fields for services that publish
ports in ingress mode.

Additional unit tests cases have been updated.

This fix is related to 30232.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-04-03 18:40:15 -07:00
Victor Vieux
21ec12b967 Merge pull request #31144 from aaronlehmann/synchronous-service-commands
Synchronous service create and service update
2017-04-03 17:44:03 -07:00
Daniel Nephin
25f00866e3 Fix endpoint mode in Compose format.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-04-03 17:51:31 -04:00
Aaron Lehmann
330a003533 Synchronous service create and service update
Change "service create" and "service update" to wait until the creation
or update finishes, when --detach=false is specified. Show progress bars
for the overall operation and for each individual task (when there are a
small enough number of tasks), unless "-q" / "--quiet" is specified.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-03 09:46:01 -07:00
Vincent Demeester
d9c3c1928d Merge pull request #31989 from aaronlehmann/node-ps-outside-swarm-mode
cli: Wrong error message from "node ps" outside swarm mode
2017-04-03 16:15:24 +02:00
Sebastiaan van Stijn
571e403168 Merge pull request #32282 from mstanleyjones/improve-attach-desc
Clarify meaning of docker attach
2017-04-01 20:52:26 +02:00
Victor Vieux
3dfce9fbb8 Merge pull request #31022 from jmzwcn/issue30994
docker version output is not consistent when there are downgrades or incompatibilities #30994
2017-03-31 15:55:03 -07:00
Victor Vieux
e45483964f Merge pull request #31800 from ripcurld0/checkpoint_ls
Use formatter in docker checkpoint ls
2017-03-31 15:54:22 -07:00
Misty Stanley-Jones
1922eac4cc Clarify meaning of docker attach
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2017-03-31 13:22:21 -07:00
Kenfe-Mickaël Laventure
3d31198cda Merge pull request #31599 from ripcurld0/diff_cmd_format
Use formatter in docker diff
2017-03-31 11:19:41 -07:00
Vincent Demeester
ee61f28cc3 Merge pull request #32124 from vdemeester/system-inspect-secret
Add support for `--type=secret` in `docker inspect`
2017-03-30 17:01:57 +02:00
Boaz Shuster
3dad39b957 Use formatter in docker diff
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-03-30 10:33:40 +03:00
Daniel Zhang
50aa1e5b28 Docker version output is not consistent when there are downgrades or incompatibilities.
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>
2017-03-29 21:53:19 +08:00
Sebastiaan van Stijn
bce494f7a2 Merge pull request #31830 from dnephin/refactor-cli-state
Small cleanup now that we have multiple details about the server stored on the cli
2017-03-29 13:36:32 +02:00
Vincent Demeester
4180211d80 Merge pull request #32186 from aaronlehmann/cluster-omitempty
api: Omit Cluster, Nodes, and Managers from swarm info when unavailable
2017-03-29 10:38:52 +02:00
Aaron Lehmann
3894254ddd api: Omit Cluster, Nodes, and Managers from swarm info when unavailable
Currently these fields are included in the response JSON with zero
values. It's better not to include them if the information is
unavailable (for example, on a worker node).

This turns Cluster into a pointer so that it can be left out.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-28 14:20:25 -07:00
Daniel Nephin
d3ea30de10 Add entrypoint flags to service cli.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-03-28 11:24:19 -07:00
Sebastiaan van Stijn
4df350b8c7 Merge pull request #30810 from allencloud/make-secret-ls-support-filter
make secret ls support filters in CLI
2017-03-28 13:43:19 +02:00
Vincent Demeester
71129f6be6
Add support for --type=secret in docker inspect
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-03-28 10:48:48 +02:00
Vincent Demeester
99aaf6b923 Merge pull request #31709 from dnephin/better-errors
Replace fmt.Errorf() with errors.Errorf() in the cli
2017-03-28 10:17:46 +02:00
Vincent Demeester
4155343f44 Merge pull request #32128 from vdemeester/30836-set-alias-to-servicename
Set the alias to the service name instead of the network name
2017-03-28 09:46:05 +02:00
Tibor Vass
0d08818653 Do not replace fmt.Errorf in generated file
Signed-off-by: Tibor Vass <tibor@docker.com>
2017-03-27 18:33:41 -07:00
Tibor Vass
febbe38796 Manually reorganize import paths to segregate stdlib and 3rd-party packages
Signed-off-by: Tibor Vass <tibor@docker.com>
2017-03-27 18:21:59 -07:00
Madhu Venugopal
04295d26df Merge pull request #31714 from aboch/cingr
Allow user to replace ingress network
2017-03-27 07:30:42 -07:00
Vincent Demeester
ee08c8542a
Set the alias to the service name instead of the network name
This makes it work a little closer to compose part and it is more
correct 👼

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-03-27 11:42:15 +02:00
allencloud
3935074016 make secret ls support filters in CLI
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-03-27 10:16:45 +08:00
Alessandro Boch
d59d19c328 Allow user to modify ingress network
Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-03-26 15:46:18 -07:00
Vincent Demeester
ab08a571d1 Merge pull request #31976 from Microsoft/jjh/csbooboo
Windows: Remove --credentialspec flag
2017-03-26 12:44:27 +02:00
Daniel Nephin
7b7ea8ab81 Replace fmt.Errorf() with errors.Errorf() in the cli
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-03-24 16:58:07 -04:00
Daniel Nephin
7236686987 Fix external volume error to pass validation.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-03-24 16:55:04 -04:00
Daniel Nephin
b03a185723 Cleanup compose convert error messages.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-03-24 10:43:28 -04:00
Vincent Demeester
8d2a82853c Merge pull request #32042 from vdemeester/compose-interpolate-error-instead-of-panic
[compose/interpolation] Make sure we error out instead of panic during interpolation
2017-03-24 09:00:06 +01:00
John Howard (VM)
53d6aadda5 Windows: Remove --credentialspec flag
Signed-off-by: John Howard (VM) <jhoward@ntdev.microsoft.com>
2017-03-23 10:01:04 -07:00
Sebastiaan van Stijn
ad530ffee0 Merge pull request #31986 from Microsoft/jjh/fix28267
Windows: Don't close client stdin handle to avoid hang
2017-03-23 16:35:54 +01:00
Vincent Demeester
c165a8bfa1
Make sure we error out instead of panic during interpolation
Use type assertion to error out if the type isn't the right one
instead of panic as before this change.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-03-23 16:09:57 +01:00
Vincent Demeester
bb1ae453a6 Merge pull request #32002 from vdemeester/compose-remove-type-dict
Remove compose types.Dict alias
2017-03-22 23:08:09 +01:00
Vincent Demeester
d3dc27d145
Remove compose types.Dict alias
It is just an alias type and make the code a little bit more complex
and hard to use from outside `compose` package.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-03-22 16:16:20 +01:00
Tonis Tiigi
385f1174ff Return proper exit code on builder panic
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-03-21 19:09:23 -07:00
Aaron Lehmann
ad1c96c6a7 cli: Wrong error message from "node ps" outside swarm mode
"docker node ps" behaves strangely outside swarm mode:

    $ docker node ps
    ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE       ERROR               PORTS
    Error: No such node:

It should explain that the node is not a swarm manager.

The reason this happens is that the argument to "docker node ps" defaults
to "self". The first thing the command does is try to resolve "self" to
a node ID using the /info endpoint. If there is no node ID, it tries to
use the empty string as an ID, and tries to GET /nodes/, which is not a
valid endpoint.

Change the command to check if the node ID is present in the /info
response. If it isn't, a swarm API endpoint can supply a useful error
message.

Also, avoid printing the column headers if the only following text is an
error.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-21 17:01:07 -07:00
John Howard (VM)
91e971c0fe Windows: Don't close client stdin handle to avoid hang
Signed-off-by: John Howard (VM) <jhoward@microsoft.com>
2017-03-21 16:00:17 -07:00
Victor Vieux
afe1c5c2eb Merge pull request #31705 from cyli/bump-go-connections
Use either a system pool or custom CA pool when connecting from client->daemon (+go-connections version bump)
2017-03-21 10:36:41 -07:00
Vincent Demeester
f965aab5e9 Merge pull request #31621 from dnephin/cleanup-container-run-command
Some cleanup of container run command
2017-03-21 16:01:11 +01:00
Sebastiaan van Stijn
1ec77baed9 Merge pull request #31552 from ripcurld0/add_format_secretls
Add format to secret ls
2017-03-20 20:20:45 +01:00
Vincent Demeester
550b06ab6a Merge pull request #31948 from vdemeester/compose-typo
Fixing a small typo in compose loader package
2017-03-20 17:48:50 +01:00
Daniel Nephin
4152243985 Create a new ServerType struct for storing details about the server on the client.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-03-20 12:48:25 -04:00
Vincent Demeester
b8c45c3a57
Fixing a small typo in compose loader package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-03-20 15:39:57 +01:00
liker12134
2333b39b37 fixed:go vetting warning unkeyed fields
Signed-off-by: Aaron.L.Xu <liker.xu@foxmail.com>
2017-03-20 16:30:01 +08:00
Boaz Shuster
f9d2636787 Use formatter in docker checkpoint ls
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-03-19 09:24:15 +02:00
Boaz Shuster
e281fe9c3a Add format to secret ls
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-03-19 09:22:30 +02:00
Vincent Demeester
8bc703804d Merge pull request #30781 from AkihiroSuda/fix-stack-env
compose: fix environment interpolation from the client
2017-03-17 15:56:50 +01:00
Akihiro Suda
2cdc9c42eb compose: update the comment about MappingWithEquals
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-03-17 06:21:55 +00:00
Sebastiaan van Stijn
d376b18caf Merge pull request #31896 from aaronlehmann/move-secretrequestoption
api: Remove SecretRequestOption type
2017-03-16 21:31:15 +01:00
Sebastiaan van Stijn
f5c57d88a4 Merge pull request #31886 from daniel48/master
fix a typo
2017-03-16 21:30:22 +01:00
Sebastiaan van Stijn
3eaeee07c3 Merge pull request #31894 from dnephin/fix-schema-id
Fix compose schema id for v3.2
2017-03-16 21:19:59 +01:00
Aaron Lehmann
e7c39f4d5d api: Remove SecretRequestOption type
This type is only used by CLI code. It duplicates SecretReference in the
types/swarm package. Change the CLI code to use that type instead.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-16 11:20:31 -07:00
Daniel Nephin
576d2181e4 Fix compose schema id for v3.2
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-03-16 13:53:58 -04:00
Pure White
1d61f11e34 fix a typo
when i was using:
docker search --automated -s 3 nginx
told me:
Flag --automated has been deprecated, use --filter=automated=true instead
Flag --stars has been deprecated, use --filter=stars=3 instead
and when i use:
docker search --filter=automated=true --filter=stars=3 nginx
told me:
Error response from daemon: Invalid filter 'automated'
and i found out that the correct command should be:
docker search --filter=is-automated=true --filter=stars=3 nginx

Signed-off-by: Pure White <daniel48@126.com>
2017-03-16 23:11:57 +08:00
Sebastiaan van Stijn
e638089622 Add missing API version annotations to commands
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-03-16 13:40:12 +01:00
Vincent Demeester
52143aee95 Merge pull request #31775 from erxian/misleading-default-for-update-monitor-duration-flag
misleading default for --update-monitor duration
2017-03-16 10:13:26 +01:00
Vincent Demeester
8316753f96 Merge pull request #31866 from gdevillele/pr_service_create
improve semantics of utility function in cli/command/service
2017-03-16 10:12:15 +01:00
Akihiro Suda
87c5f67cfa Merge pull request #31057 from krasi-georgiev/30779-fix-client-login-credentials-save-domain
fix incorect login client credential save when the registry is the default docker registry
2017-03-16 13:19:32 +09:00
Gaetan de Villele
1526a99672 improve semantics of utility function in cli/command/service
Signed-off-by: Gaetan de Villele <gdevillele@gmail.com>
2017-03-15 13:49:52 -07:00
Victor Vieux
4bce232139 Revert "Planned 1.13 deprecation: email from login"
This reverts commit a66efbddb8.

Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-03-15 10:43:18 -07:00
Sebastiaan van Stijn
b0d1936d30 Merge pull request #31302 from dnephin/purge-orphaned-services
Add --prune to stack deploy
2017-03-15 12:57:06 +01:00
erxian
3e6ff87f69 misleading default for --update-monitor duration
Signed-off-by: erxian <evelynhsu21@gmail.com>
2017-03-15 14:20:02 +08:00
Anusha Ragunathan
95b46ff68f Merge pull request #31147 from adshmh/30629-print-escaping-hint-on-invalid-interpolation-format
docker stack deploy interpolation format error due to not escaping $ now includes a hint
2017-03-14 17:14:09 -07:00
Daniel Nephin
644fd804fc Add --prune to stack deploy.
Add to command line reference.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-03-14 16:09:28 -04:00
Daniel Nephin
a9c86b63c0 Fix environment resolving.
Load from env should only happen if the value is unset.
Extract a buildEnvironment function and revert some changes to tests.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-03-14 16:00:43 -04:00
Akihiro Suda
ea43c33330 compose: fix environment interpolation from the client
For an environment variable defined in the yaml without value,
the value needs to be propagated from the client, as in Docker Compose.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-03-14 15:59:40 -04:00
Victor Vieux
1a24abe42d Merge pull request #31809 from vieux/bump_api
bump API to 1.28
2017-03-14 11:53:52 -07:00
Daniel Nephin
cd56476f18 Merge pull request #31795 from dnephin/compose-file-v3.2
Compose file v3.2
2017-03-14 14:10:24 -04:00
Justin Cormack
49376cddab Merge pull request #30597 from dnephin/add-expanded-mount-format-to-stack-deploy
Add expanded mount format to stack deploy
2017-03-14 17:53:28 +00:00
Victor Vieux
cd173a6030 bump API to 1.28
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-03-14 09:32:50 -07:00