Also rename func for non-windows specific names.
Signed-off-by: Sachin Joshi <sachin_jayant_joshi@hotmail.com>
Upstream-commit: 45262c4cb057e78ba98d02b5e0121ed402779c7f
Component: engine
It is implemented by intercepting and interpreting the output
escape sequence by calling win32 console apis.
In addition the input from win32 console is translated to linux keycodes
Signed-off-by: Sachin Joshi <sachin_jayant_joshi@hotmail.com>
Upstream-commit: d8c3090dd9abe3f0d95f99c9d8c7660922e9a719
Component: engine
delete unecessary blank after "[OPTIONS] "
and add a blank to the log between options and signature.
To make the code style consistency.
Signed-off-by: Zen Lin(Zhinan Lin) <linzhinan@huawei.com>
Upstream-commit: 2b051bcbda06ec48287e75da506bacf95be2b652
Component: engine
Makes sure the CLI does not use HTTP_PROXY when connecting to unix
socket.
Also adds some tests to make sure this functionality works as expected.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: f6e697d2ace2ea659c1b3f7e3dcef7493baa481c
Component: engine
Refactored getHomeDir in docker/docker to GetHomeDir in utils
pkg. Currently covers all use cases on the client-side.
Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
Upstream-commit: 6ffb77afd4c3705322417f0673d254038f01a187
Component: engine
Ignoring return value of ParseFlags leads to exit code 0 if bad
arguments are supplied. This patch makes sure that subcommands exit
with non-zero code in such a case.
Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: 8a785792cd3c3fb4494bced475263aef5fa4534b
Component: engine
--help and help are successful commands so output should not go to error.
QE teams have requested this change, also users doing docker help | less
or docker run --help | less would expect this to work.
Usage statement should only be printed when the user asks for it.
Errors should print error message and then suggest the docker COMMAND --help
command to see usage information.
The current behaviour causes the user to have to search for the error message
and sometimes scrolls right off the screen. For example a error on a
"docker run" command is very difficult to diagnose.
Finally erros should always exit with a non 0 exit code, if the user
makes a CLI error.
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: a2b529ead21e6ab9eafcb1b1d2437c725c43a06a
Component: engine
Forbid `docker run -t` with a redirected stdin (such as `echo test |
docker run -ti busybox cat`). Forbid `docker exec -t` with a redirected
stdin. Forbid `docker attach` with a redirect stdin toward a tty enabled
container.
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 67e3ddb75ff27b8de0022e330413b4308ec5b010
Component: engine
E.g. "docker foobar run" would have printed "Command not found:
foobar" and printed the help text for "run". It should instead
print the root help message for docker.
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
Upstream-commit: ef004ec03fe5aad33da7d53f196f16382c750d07
Component: engine
First off, sorry for the noise. This is a cleaner step of #8508
Found more of a root cause of the open file handles.
After more testing I found that the open file descriptors will still
occur for TCP:// connections to the daemon, causing client and/or daemon
to fail.
The issue was instantiating a new http.Transport on _ever_ client
request. So each instance held the prior connection alive, but was only
ever used once.
By moving it out to the initilization of DockerCli, we can now have
reuse of idled connections. Simplifies the garbage overhead of the
client too, though that's not usually a deal.
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: da42ae536cf86dafbdad88901b9322ea7317f154
Component: engine
`docker events > /tmp/out` should not print control
characters to non-terminal STDOUT.
This addresses commit 26b4a4920adca614f6be17a96f254f331271faf0
without creating regression described in issue #6509.
Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
Upstream-commit: d742c57f534352b6cad596d0c9fe8cf84044e92a
Component: engine
Cli IsTerminal() SYS_IOCTL operation should be determined from STDIN,
not from STDOUT.
Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
Upstream-commit: 40c7b53791b598364ffe2290c88875e4fc65be11
Component: engine
E.g. "docker groups create" will attempt to call the function
CmdGroupsCreate
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
Upstream-commit: e1b968f1981f21470a67ed617c36f1c6802bd0a7
Component: engine
--help and help are successful commands so output should not go to error.
QE teams have requested this change, also users doing docker help | less
or docker run --help | less would expect this to work.
Usage statement should only be printed when the user asks for it.
Errors should print error message and then suggest the docker COMMAND --help
command to see usage information.
The current behaviour causes the user to have to search for the error message
and sometimes scrolls right off the screen. For example a error on a
"docker run" command is very difficult to diagnose.
Finally erros should always exit with a non 0 exit code, if the user
makes a CLI error.
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 61b129d81802e3c988cc0e67e488b24968dd748a
Component: engine
If I do a
docker events > /tmp/out
I do not want the control characters getting written to the file.
The check should check the output file not the input file.
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 26b4a4920adca614f6be17a96f254f331271faf0
Component: engine
This patch fixes the problem.
Docker-DCO-1.1-Signed-off-by: Daniel Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: bc081a03d85a88cc2160ade9256d96d7b84c4caa
Component: engine