1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/opts
Yong Tang 846baf1fd3 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>
2016-11-04 09:43:10 -07:00
..
hosts.go Fix opts tests after default port fix 2016-06-21 17:14:55 -07:00
hosts_test.go Fix opts tests after default port fix 2016-06-21 17:14:55 -07:00
hosts_unix.go Finish linting opts and trust package. 2015-08-27 17:36:11 +02:00
hosts_windows.go Windows: Default to npipe transport 2016-03-01 18:27:01 -08:00
ip.go Convert dockerd to use cobra and pflag 2016-08-25 13:09:03 -04:00
ip_test.go golint: trust 2015-08-27 11:40:27 +02:00
mount.go cli: add --mount to docker run 2016-11-03 07:08:59 +00:00
mount_test.go cli: add --mount to docker run 2016-11-03 07:08:59 +00:00
opts.go Add --cpus flag to control cpu resources 2016-11-04 09:43:10 -07:00
opts_test.go Allow to set daemon and server configurations in a file. 2016-01-14 16:44:37 -05:00
opts_unix.go Windows [TP4] localhost mitigation 2015-11-06 13:52:59 -08:00
opts_windows.go Windows: Remove TP4 support from main code 2016-04-06 12:12:20 -07:00