Commit Graph

26 Commits

Author SHA1 Message Date
d601c75fe5 Convert 'docker run' to a cobra command and to use pflags
Move container options into a struct so that tests should pass.
Remove unused FlagSet arg from Parse
Disable interspersed args on docker run

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a77f2450c70312f8c26877a18bfe2baa44d4abb9
Component: engine
2016-06-04 13:55:35 +02:00
c8d36013e6 Rework usage of context.Context in api/client
Make better default usage on context.Context on the `api/client` package
to share the context (it is useless if not shared, which was the case
for a lot of commands).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 4c7f0d268f413b4a55ea638a97382d9316d082af
Component: engine
2016-05-21 15:57:57 +02:00
b48cb728b8 Update client code with api changes
Using new methods from engine-api, that make it clearer which element is
required when consuming the API.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: b9c94b70bf2f703f260844b3862a61f93dee6337
Component: engine
2016-04-15 12:48:01 +02:00
eeff19f114 cli: move setRawTerminal and restoreTerminal to holdHijackedConnection
In this way, we can restore the Terminal as soon as possible once the hijacked
connection end. This not only fix weird output if cli enable -D, but also
remove duplicate code.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 66d3dcc6f7648ab5af3c7f876c2b9c63ab2899ac
Component: engine
2016-03-24 21:25:50 -04:00
44ad0dbdfd Update api/client file to use context
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 8567286ed65c8aca180b4590acf7d9ef61e15955
Component: engine
2016-03-16 20:25:09 +01:00
31eb5171fa Move tty set and restore to caller
Fixes #19506

This fixes the issue of errors on create and the tty not being able to
be restored to its previous state because of a race where it was
in the hijack goroutine.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: a1eb6029cc4e4ccd820b0aac147a6121f1967ba2
Component: engine
2016-01-20 13:32:19 -08:00
4ec2693c9e Modify import paths to point to the new engine-api package.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 907407d0b2e5863f0e1b40b93a356bbf03c7b9fb
Component: engine
2016-01-06 19:48:59 -05:00
29d22b9aad Move ParseExec to the client where it is used.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4c0d586bd3a1b81cfba78af89af02be56041bc6b
Component: engine
2016-01-04 12:06:29 -05:00
5582f5eb83 Implement configurable detach key
Implement configurable detach keys (for `attach`, exec`, `run` and
`start`) using the client-side configuration

- Adds a `--detach-keys` flag to `attach`, `exec`, `run` and `start`
  commands.
- Adds a new configuration field (in `~/.docker/config.json`) to
  configure the default escape keys for docker client.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 15aa2a663b47b6126a66efefcadb64edfbffb9f5
Component: engine
2016-01-03 23:03:39 +01:00
bacc70658e Implement docker exec with standalone client lib.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 3f9f23114f7cccd9e9972d457f0f1d2502eaa4af
Component: engine
2015-12-09 12:04:59 -05:00
f0927e3716 Check the content type is json when calling exec start.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 45dc57f22931e6cb8ad522602da8aa985bddcfab
Component: engine
2015-10-19 11:46:44 -04:00
262c5c28a2 Use consistent command description
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 2b0927c9ac23b66d8a05761801d1c5f882ba8dfb
Component: engine
2015-10-08 08:46:21 -04:00
12234c67d4 cli: new daemon command and new cli package
This patch creates a new cli package that allows to combine both client
and daemon commands (there is only one daemon command: docker daemon).

The `-d` and `--daemon` top-level flags are deprecated and a special
message is added to prompt the user to use `docker daemon`.

Providing top-level daemon-specific flags for client commands result
in an error message prompting the user to use `docker daemon`.

This patch does not break any old but correct usages.

This also makes `-d` and `--daemon` flags, as well as the `daemon`
command illegal in client-only binaries.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 96ce3a194aab2807fdd638825b9ea7cb9ba55c36
Component: engine
2015-07-23 19:44:46 -04:00
c8344b3dc3 Windows: Remove meaningless warnings on docker info
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 615681f5177cef974d516d5814195c768e773dd2
Component: engine
2015-07-10 10:06:20 -07:00
a462e56268 api/client: close the returned io.ReadCloser
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Upstream-commit: 91a496055c3e45ab3fba8e643475adb618581e1f
Component: engine
2015-07-08 10:06:25 +08:00
4cf65f9e74 Merge pull request #13869 from jlhawn/multi_line_help_usage
api/client: Allow for multi-line usage help
Upstream-commit: 86d6a5b11f74e7cc302dc8ccc7ec82119763cb5a
Component: engine
2015-06-15 14:50:17 -07:00
1f7c141bcf api/client: have cli.call() return headers
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 0cdc3b7539b618778becf233157604698b4e8281
Component: engine
2015-06-10 16:20:13 -07:00
8f5fcaf455 api/client: Allow for multi-line usage help
Subcommands can provide multiple usage synopses.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 4cb0c93f9287d29934894c871d156801122516cd
Component: engine
2015-06-10 16:14:45 -07:00
2e83148ffd Use stderr instead of logrus for CLI error messages
Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 0024935f641ab596732f9162d3eab795bbc2ae06
Component: engine
2015-05-12 17:22:41 -07:00
f089bf1e0a remove execCreate & execStart from job
Also removed the function ExecConfigFromJob

Signed-off-by: Sun Jianbo <wonderflow@zju.edu.cn>
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 24425021d26f29a475702064181e6c99fb6bd1c5
Component: engine
2015-04-22 13:51:57 -07:00
1931a4d310 client.StatusError don't be returned as a pointer
closes #12373

1. remove & from client.StatusError
2. remove * from Error method

Signed-off-by: Deshi Xiao <xiaods@gmail.com>
Upstream-commit: bae3023eef0ed8e0eb517ca53f6f97f1bf6786d3
Component: engine
2015-04-16 01:27:07 +08:00
a4111cba55 Refactor utils/utils, fixes #11923
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: c30a55f14dbbe3971ba0ac716ba69a60868f4490
Component: engine
2015-04-14 01:37:36 +02:00
e5b36a723c Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 6f4d847046cb4e072de61d042c0266190d73a8c9
Component: engine
2015-03-26 23:22:04 +01:00
04f472f007 Fix for issue 9922: private registry search with auth returns 401
Signed-off-by: Don Kjer <don.kjer@gmail.com>
Upstream-commit: 6b2eeaf8965bac07022752c411b1f8a0f35f9571
Component: engine
2015-03-26 18:59:16 +00:00
ef0a4fa398 Add godoc-style docstrings to Cmd... methods
Signed-off-by: Peggy Li <peggyli.224@gmail.com>
Upstream-commit: b5d0380108dde9e96d51bb01821860a0799dee0d
Component: engine
2015-03-25 14:17:11 -07:00
ff6913868d api/client - The code for all cli commands are in one file #11610
Signed-off-by: Joey Gibson <joey@joeygibson.com>
Upstream-commit: 58690c9cca5995035b721ed6f1337b0ddb932d7a
Component: engine
2015-03-24 23:57:23 -04:00