moby--moby/api/types/container
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
..
config.go 'eg.' should be 'e.g.' 2016-09-21 13:48:06 +08:00
container_create.go Generate container create response from swagger spec. 2016-10-31 11:16:02 -04:00
container_update.go Generate container update response from swagger spec. 2016-10-31 11:16:02 -04:00
container_wait.go Generate ContainerWait response from the swagger spec. 2016-10-31 11:19:53 -04:00
host_config.go Add `--cpus` flag to control cpu resources 2016-11-04 09:43:10 -07:00
hostconfig_unix.go add swarm type comments and fix nits 2016-09-26 17:17:52 +08:00
hostconfig_windows.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00