Commit Graph

1303 Commits

Author SHA1 Message Date
3e6d08e7ea Unify swarm init and update options
Add api side validation and defaults for init and
join requests.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 881833232e
Component: cli
2017-05-15 11:57:19 +02:00
8c71d519a4 Add Swarm management backend
As described in our ROADMAP.md, introduce new Swarm management API
endpoints relying on swarmkit to deploy services. It currently vendors
docker/engine-api changes.

This PR is fully backward compatible (joining a Swarm is an optional
feature of the Engine, and existing commands are not impacted).

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: 4f87181ba9
Component: cli
2017-05-15 11:57:19 +02:00
a3e334ca24 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 662b3de10a
Component: cli
2017-05-15 11:57:18 +02:00
a81f1c609e Update usage and help to (almost) match the existing docker behaviour
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 17b3d05419
Component: cli
2017-05-15 11:57:18 +02:00
b3d34e0946 Migrate volume commands to cobra.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b9fe270259
Component: cli
2017-05-15 11:57:18 +02:00
f488d74f98 Add support for setting sysctls
This patch will allow users to specify namespace specific "kernel parameters"
for running inside of a container.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Upstream-commit: 1419abf7b2
Component: cli
2017-05-15 11:57:18 +02:00
64601c2a52 Windows: Remove TP4 support from main code
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 1688110fd6
Component: cli
2017-05-15 11:57:18 +02:00
8bed41f5cf fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: a5f0686bf0
Component: cli
2017-05-15 11:57:18 +02:00
323e48b77a Windows: Default to npipe transport
This changes the default transport for Windows from unencrypted TCP to
npipe. This is similar to how Linux runs with the unix socket transport by
default.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 6ad28f55d5
Component: cli
2017-05-15 11:57:18 +02:00
8d201cc78c Upgrade Go to 1.6.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 2b140819b3
Component: cli
2017-05-15 11:57:18 +02:00
d3df82c920 Windows: Add support for named pipe protocol
This adds an npipe protocol option for Windows hosts, akin to unix
sockets for Linux hosts. This should become the default transport
for Windows, but this change does not yet do that.

It also does not add support for the client side yet since that
code is in engine-api, which will have to be revendored separately.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 5d648746e8
Component: cli
2017-05-15 11:57:17 +02:00
939dc7147c Allow to set daemon and server configurations in a file.
Read configuration after flags making this the priority:

1- Apply configuration from file.
2- Apply configuration from flags.

Reload configuration when a signal is received, USR2 in Linux:

- Reload router if the debug configuration changes.
- Reload daemon labels.
- Reload cluster discovery.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: d611dc46c0
Component: cli
2017-05-15 11:57:17 +02:00
2e3f784e06 Move some validators from opts to runconfig/opts.
These validators are only used by runconfig.Parse() or some other part of the
client, so move them into the client-side package.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e73db35cbf
Component: cli
2017-05-15 11:57:17 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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