Commit Graph

1318 Commits

Author SHA1 Message Date
a3052deb52 fix a few golint errors
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 4d5944cd51
Component: cli
2017-05-15 11:57:20 +02:00
8543a49ef3 fix t.Errorf to t.Error in serveral _test.go
Signed-off-by: wefine <wang.xiaoren@zte.com.cn>
Upstream-commit: 9806df060b
Component: cli
2017-05-15 11:57:20 +02:00
283b152e13 Add support for host port PublishMode in services
Add api/cli support for adding host port PublishMode in services.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Upstream-commit: 7426b9d61b
Component: cli
2017-05-15 11:57:20 +02:00
7f7816f275 Add swarmkit fields to stack service.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 18ad4598a8
Component: cli
2017-05-15 11:57:20 +02:00
4f8d2f0ec7 SecretRequestOptions -> SecretRequestOption
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 9d3c317c95
Component: cli
2017-05-15 11:57:20 +02:00
17050a7d9e secrets: support simple syntax --secret foo
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 7180c8afed
Component: cli
2017-05-15 11:57:19 +02:00
8e84f86f88 move secretopt to opts pkg
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 20525b5695
Component: cli
2017-05-15 11:57:19 +02:00
25d6f1620e Remove -ptr from the help output of service create
This fix is based on the comment:
https://github.com/docker/docker/pull/28147#discussion_r86996347

Previously the output string of the `DurationOpt` is `duration-ptr`
and `Uint64Opt` is `uint64-ptr`. While it is clear to developers,
for a normal user `-ptr` might not be very informative.

On the other hand, the default value of `DurationOpt` and `Uint64Opt`
has already been quite informative: `none`. That means if no flag
provided, the value will be treated as none.
(like a ptr with nil as the default)

For that reason this fix removes the `-ptr`.

Also, the output in the docs of `service create` has been quite
out-of-sync with the true output. So this fix updates the docs
to have the most up-to-date help output of `service create --help`.

This fix is related to #28147.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 583dd83727
Component: cli
2017-05-15 11:57:19 +02:00
1a65247350 opts/mount: add tmpfs-specific options
added following options:

 * tmpfs-size
 * tmpfs-mode

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 547dc2052c
Component: cli
2017-05-15 11:57:19 +02:00
bca6247652 Add --cpus flag to control cpu resources
This fix tries to address the proposal raised in 27921 and add
`--cpus` flag for `docker run/create`.

Basically, `--cpus` will allow user to specify a number (possibly partial)
about how many CPUs the container will use. For example, on a 2-CPU system
`--cpus 1.5` means the container will take 75% (1.5/2) of the CPU share.

This fix adds a `NanoCPUs` field to `HostConfig` since swarmkit alreay
have a concept of NanoCPUs for tasks. The `--cpus` flag will translate
the number into reused `NanoCPUs` to be consistent.

This fix adds integration tests to cover the changes.

Related docs (`docker run` and Remote APIs) have been updated.

This fix fixes 27921.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 17e9503bbb
Component: cli
2017-05-15 11:57:19 +02:00
fc08f2c126 cli: add --mount to docker run
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 3375ba2acd
Component: cli
2017-05-15 11:57:19 +02:00
f8263c2df8 Add engine-api types to docker
This moves the types for the `engine-api` repo to the existing types
package.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 11d7f42b49
Component: cli
2017-05-15 11:57:19 +02:00
c2d278ab8c correct some nits in comment and test files
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 6083de8891
Component: cli
2017-05-15 11:57:19 +02:00
d94e1f7806 Convert dockerd to use cobra and pflag
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: ac76967dba
Component: cli
2017-05-15 11:57:19 +02:00
68e6f77ee4 Fix opts tests after default port fix
The code for default port was already there but
it didn’t work because split function errored out
before. This should be the desired behavior that
matches daemon listen address with swarm listen
address.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 63d756f347
Component: cli
2017-05-15 11:57:19 +02:00
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