1
0
mirror of https://github.com/docker/cli.git synced 2026-01-18 08:21:31 +03:00
Commit Graph

1317 Commits

Author SHA1 Message Date
Daniel Nephin
2e992ff0de Move ulimit options to runconfig opts
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: cef8b71ff4
Component: cli
2017-05-15 11:57:17 +02:00
Daniel Nephin
21a599d64a Move runconfig blkiodev options and parsing into runconfig/opts package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 5d99388c23
Component: cli
2017-05-15 11:57:17 +02:00
David Calavera
32138ef056 Move blkiodev package to types.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 757d284759
Component: cli
2017-05-15 11:57:17 +02:00
Ma Shimiao
e11e267b2a Add support for blkio read/write iops device
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Upstream-commit: 369f057818
Component: cli
2017-05-15 11:57:17 +02:00
Daniel Nephin
c8903ae701 Move ParseLink and validators into runconfig.parse where they are used.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 659fac261b
Component: cli
2017-05-15 11:57:16 +02:00
David Calavera
6515a5428f Replace pkg/units with docker/go-units.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: bfba6ec070
Component: cli
2017-05-15 11:57:16 +02:00
Daniel Nephin
853ff6bcdf Move ParseDockerDaemonHost to opts/ package.
This function was only being used from a single place opts/opts.go. This
change moves it from a incohesive package (parsers) to the single place it
is used.

Also made a bunch of the helper methods private because they are not used
by any external modules.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 7dc7bff9a0
Component: cli
2017-05-15 11:57:16 +02:00
Justas Brazauskas
93648b6f75 Fix typos found across repository
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
Upstream-commit: f599afe64e
Component: cli
2017-05-15 11:57:16 +02:00
Ma Shimiao
0590433522 Add support for blkio read/write bps device
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Upstream-commit: 02a6d3c5e6
Component: cli
2017-05-15 11:57:16 +02:00
David Calavera
c57627e61c Move Container to its own package.
So other packages don't need to import the daemon package when they
want to use this struct.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 9837646cd1
Component: cli
2017-05-15 11:57:16 +02:00
Ma Shimiao
0303571260 opts/weightdevice: fix typo
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Upstream-commit: 35c223629b
Component: cli
2017-05-15 11:57:16 +02:00
Ma Shimiao
0076674ef2 Add support for blkio.weight_device
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Upstream-commit: 8a67a18fd8
Component: cli
2017-05-15 11:57:16 +02:00
David Calavera
b3dc9d59cd Use an empty slice as default value for DNS, DNSSearch and DNSOptions
So we don't print those <no value> in the client and we don't fail
executing inspect templates with API field names.

Make sure those fields are initialized as empty slices when
a container is loaded from disk and their values are nil.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 8c734c8cde
Component: cli
2017-05-15 11:57:16 +02:00
John Howard
5876d7ee7a Windows [TP4] localhost mitigation
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: d02ac2a694
Component: cli
2017-05-15 11:57:16 +02:00
Shijiang Wei
7c5afb91b2 Add ability to add multiple tags with docker build
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: 36030a9a8b
Component: cli
2017-05-15 11:57:15 +02:00
John Howard
91335091e8 Windows: Add volume support
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: af6e545164
Component: cli
2017-05-15 11:57:15 +02:00
Lei Jitang
1cce121885 Make default tls host work
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 74d0203af0
Component: cli
2017-05-15 11:57:15 +02:00
Doug Davis
26685a1f17 Remove used param on ParseHost
The first param on opts.ParseHost() wasn't being used for anything.

Once we get rid of that param we can then also clean-up some code
that calls ParseHost() because the param that was passed in wasn't
being used for anything else.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 1398bd9861
Component: cli
2017-05-15 11:57:15 +02:00
Sven Dowideit
700e7bbf64 Default the tcp port to 2376 if tls is on, and 2375 if not
Refactor so that the Host flag validation doesn't destroy the user's input,
and then post process the flags when we know the TLS options

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
Upstream-commit: 6ad0875074
Component: cli
2017-05-15 11:57:15 +02:00
Vincent Demeester
f8687bd8be Revert environment regexp from 13694
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: aca36e11f2
Component: cli
2017-05-15 11:57:15 +02:00
Ma Shimiao
e95263172c opts/opts.go: fix typo
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Upstream-commit: 863be38db7
Component: cli
2017-05-15 11:57:15 +02:00
Sven Dowideit
54bf4f9b92 Change ParseTCPAddr to use tcp://127.0.0.0:2375 format as default consistently
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
Upstream-commit: 2d2863ebd5
Component: cli
2017-05-15 11:57:15 +02:00
Vincent Demeester
fd09cd3139 Finish linting opts and trust package.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 59ffb24c8f
Component: cli
2017-05-15 11:57:15 +02:00
Sevki Hasirci
e746cef309 golint: trust
contributes to #14756

Signed-off-by: Sevki Hasirci <s@sevki.org>
Upstream-commit: 1c5cd03b1b
Component: cli
2017-05-15 11:57:15 +02:00
Sevki Hasirci
78282ac5a8 Opts lint issues, ip and ulimit
Signed-off-by: Sevki Hasirci <s@sevki.org>
Upstream-commit: 409920de5c
Component: cli
2017-05-15 11:57:15 +02:00
Brian Goff
476d2d284b Add volume API/CLI
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: f2934dbacf
Component: cli
2017-05-15 11:57:14 +02:00
Qiang Huang
82951125a6 Add mode check for device
This fixes two problems:
1. docker run --device /dev/sda:rw ubuntu bash doesn't work
2. --device /dev/zero:/dev/noro:ro doesn't show clear error message,
but fail when writing to cgroup file.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 22e1ac4966
Component: cli
2017-05-15 11:57:14 +02:00
Qiang Huang
4077014853 Change return value for ValidateMountMode
1. rename it from ValidateMountMode to ValidMountMode
Because it's a function simply check mount mode is valid or not.
2. remove the rw check return value
It's not supposed to be combined into this function, and we already
have a function for that check.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 6a31056ff6
Component: cli
2017-05-15 11:57:14 +02:00
Matt Robenolt
a270c8bf74 opts/envfile: trim all leading whitespace in a line
Signed-off-by: Matt Robenolt <matt@ydekproductions.com>
Upstream-commit: 869e08a12b
Component: cli
2017-05-15 11:57:14 +02:00
Qiang Huang
b765600600 Change all docker -d to docker daemon
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 091f800069
Component: cli
2017-05-15 11:57:14 +02:00
Antonio Murdaca
90369e329a Remove unused functions
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 351ac873e0
Component: cli
2017-05-15 11:57:14 +02:00
Shishir Mahajan
5b6cb6cb28 Add and modify tests for legacy and new daemon invokations
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: f3841a1d27
Component: cli
2017-05-15 11:57:14 +02:00
Tibor Vass
092610c5eb 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: f55d8241cf
Component: cli
2017-05-15 11:57:14 +02:00
Vincent Demeester
265a65f776 Add test coverage to opts and refactor
- Refactor opts.ValidatePath and add an opts.ValidateDevice
  ValidePath will now accept : containerPath:mode, hostPath:containerPath:mode
  and hostPath:containerPath.
  ValidateDevice will have the same behavior as current.

- Refactor opts.ValidateEnv, opts.ParseEnvFile
  Environment variables will now be validated with the following
  definition :
  > Environment variables set by the user must have a name consisting
  > solely of alphabetics, numerics, and underscores - the first of
  > which must not be numeric.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 7b9ceadc4d
Component: cli
2017-05-15 11:57:14 +02:00
Matthieu Hauglustaine
2249f7363a Add unit tests for ParseEnvFile.
Add unit tests of the ParseEnvFile function. Test for:
* good file
* empty file
* non existent file
* badly formatted file

Signed-off-by: Matthieu Hauglustaine <matt.hauglustaine@gmail.com>
Upstream-commit: f49f44a3a3
Component: cli
2017-05-15 11:57:14 +02:00
Matthieu Hauglustaine
cdb5492521 Return bufio error if set in ParseEnvFile
Return an error value if bufio failed to properly read a token.
Avoids running a container with partial environment.

Fixes: #14266

Signed-off-by: Matthieu Hauglustaine <matt.hauglustaine@gmail.com>
Upstream-commit: 0ede41afbd
Component: cli
2017-05-15 11:57:14 +02:00
Eric-Olivier Lamey
e5cf261e6a Display empty string instead of <nil> when IP opt is nil.
Fixes #13878.

Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
Upstream-commit: 0c721e1ad5
Component: cli
2017-05-15 11:57:13 +02:00
Doug Davis
82d0cb3f4b Minor doc edit to add clarity around the --volume path format
Also add a comment to the ValidatePath func so devs/reviewers
know exactly what its looking for.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: d1be0bd11e
Component: cli
2017-05-15 11:57:13 +02:00
Doug Davis
74a2061e32 Remove duplicate call to net.ParseIP
and a little cleanup

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 292e38a144
Component: cli
2017-05-15 11:57:13 +02:00
Antonio Murdaca
290c7f1a1b Add syslog-address log-opt
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 51c5706326
Component: cli
2017-05-15 11:57:13 +02:00
Antonio Murdaca
077a92771f Allow links to be specified with only the name if this matches the alias
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: e8e6124050
Component: cli
2017-05-15 11:57:13 +02:00
wlan0
6470449577 Add log opts flag to pass in logging options
Signed-off-by: wlan0 <sidharthamn@gmail.com>
Upstream-commit: d0c32b1efa
Component: cli
2017-05-15 11:57:13 +02:00
jhowardmsft
87a8e0557c Windows: Change default listener to HTTP
Signed-off-by: jhowardmsft <jhoward@microsoft.com>
Upstream-commit: 7da142413e
Component: cli
2017-05-15 11:57:13 +02:00
Antonio Murdaca
9f1e435e6a Remove job from container_inspect
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 64a9942188
Component: cli
2017-05-15 11:57:13 +02:00
George MacRorie
5792f08680 Cleanup redundant else statements find via golint #11602
Signed-off-by: George MacRorie <gmacr31@gmail.com>
Upstream-commit: cd08d97a64
Component: cli
2017-05-15 11:57:13 +02:00
Tomáš Hrčka
6c88b9b6c8 Restrict domain name to 255 characters
Signed-off-by: Tomáš Hrčka <thrcka@redhat.com>

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)
Upstream-commit: 01245d2619
Component: cli
2017-05-15 11:57:13 +02:00
Lei Jitang
ccc7b1dd83 Add validate the input mac address on docker run command
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 8972795de7
Component: cli
2017-05-15 11:57:13 +02:00
Brian Goff
2c7c95805c Allow setting ulimits for containers
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 473eb9a2c5
Component: cli
2017-05-15 11:57:13 +02:00
Phil Estes
8471c91d34 Add more helpful error message for -add-host
Fixes: #10655

As noted in the issue, bad format was being returned even if the format
was appropriate, but the IP was invalid.  This adds a better error
message for when the IP address fails validation.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 196bc32878
Component: cli
2017-05-15 11:57:13 +02:00
Phil Estes
42e0391260 Allow IPv6 addresses in ExtraHosts option settings
Since the separator for extra host settings (for /etc/hosts in a
container) is a ":", the code that handles extra hosts needed to only
split on the first ":" to preserve IPv6 addresses which are passed via
the command line settings as well as stored in the JSON container
config.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: d656c63b21
Component: cli
2017-05-15 11:57:13 +02:00