@@ -17,13 +17,18 @@ import (
1717
1818type updateOptions struct {
1919 blkioWeight uint16
20+ blkioWeightDevice opts.WeightdeviceOpt
2021 cpuPeriod int64
2122 cpuQuota int64
2223 cpuRealtimePeriod int64
2324 cpuRealtimeRuntime int64
2425 cpusetCpus string
2526 cpusetMems string
2627 cpuShares int64
28+ deviceReadBps opts.ThrottledeviceOpt
29+ deviceWriteBps opts.ThrottledeviceOpt
30+ deviceReadIOps opts.ThrottledeviceOpt
31+ deviceWriteIOps opts.ThrottledeviceOpt
2732 memory opts.MemBytes
2833 memoryReservation opts.MemBytes
2934 memorySwap opts.MemSwapBytes
@@ -58,6 +63,7 @@ func newUpdateCommand(dockerCLI command.Cli) *cobra.Command {
5863
5964 flags := cmd .Flags ()
6065 flags .Uint16Var (& options .blkioWeight , "blkio-weight" , 0 , `Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)` )
66+ flags .Var (& options .blkioWeightDevice , "blkio-weight-device" , "Block IO weight (relative device weight)" )
6167 flags .Int64Var (& options .cpuPeriod , "cpu-period" , 0 , "Limit CPU CFS (Completely Fair Scheduler) period" )
6268 flags .Int64Var (& options .cpuQuota , "cpu-quota" , 0 , "Limit CPU CFS (Completely Fair Scheduler) quota" )
6369 flags .Int64Var (& options .cpuRealtimePeriod , "cpu-rt-period" , 0 , "Limit the CPU real-time period in microseconds" )
@@ -67,6 +73,10 @@ func newUpdateCommand(dockerCLI command.Cli) *cobra.Command {
6773 flags .StringVar (& options .cpusetCpus , "cpuset-cpus" , "" , "CPUs in which to allow execution (0-3, 0,1)" )
6874 flags .StringVar (& options .cpusetMems , "cpuset-mems" , "" , "MEMs in which to allow execution (0-3, 0,1)" )
6975 flags .Int64VarP (& options .cpuShares , "cpu-shares" , "c" , 0 , "CPU shares (relative weight)" )
76+ flags .Var (& options .deviceReadBps , "device-read-bps" , "Limit read rate (bytes per second) from a device" )
77+ flags .Var (& options .deviceReadIOps , "device-read-iops" , "Limit read rate (IO per second) from a device" )
78+ flags .Var (& options .deviceWriteBps , "device-write-bps" , "Limit write rate (bytes per second) to a device" )
79+ flags .Var (& options .deviceWriteIOps , "device-write-iops" , "Limit write rate (IO per second) to a device" )
7080 flags .VarP (& options .memory , "memory" , "m" , "Memory limit" )
7181 flags .Var (& options .memoryReservation , "memory-reservation" , "Memory soft limit" )
7282 flags .Var (& options .memorySwap , "memory-swap" , `Swap limit equal to memory plus swap: -1 to enable unlimited swap` )
@@ -110,19 +120,24 @@ func runUpdate(ctx context.Context, dockerCli command.Cli, options *updateOption
110120
111121 updateConfig := client.ContainerUpdateOptions {
112122 Resources : & containertypes.Resources {
113- BlkioWeight : options .blkioWeight ,
114- CpusetCpus : options .cpusetCpus ,
115- CpusetMems : options .cpusetMems ,
116- CPUShares : options .cpuShares ,
117- Memory : options .memory .Value (),
118- MemoryReservation : options .memoryReservation .Value (),
119- MemorySwap : options .memorySwap .Value (),
120- CPUPeriod : options .cpuPeriod ,
121- CPUQuota : options .cpuQuota ,
122- CPURealtimePeriod : options .cpuRealtimePeriod ,
123- CPURealtimeRuntime : options .cpuRealtimeRuntime ,
124- NanoCPUs : options .cpus .Value (),
125- PidsLimit : pidsLimit ,
123+ BlkioWeight : options .blkioWeight ,
124+ BlkioWeightDevice : options .blkioWeightDevice .GetList (),
125+ BlkioDeviceReadBps : options .deviceReadBps .GetList (),
126+ BlkioDeviceWriteBps : options .deviceWriteBps .GetList (),
127+ BlkioDeviceReadIOps : options .deviceReadIOps .GetList (),
128+ BlkioDeviceWriteIOps : options .deviceWriteIOps .GetList (),
129+ CpusetCpus : options .cpusetCpus ,
130+ CpusetMems : options .cpusetMems ,
131+ CPUShares : options .cpuShares ,
132+ Memory : options .memory .Value (),
133+ MemoryReservation : options .memoryReservation .Value (),
134+ MemorySwap : options .memorySwap .Value (),
135+ CPUPeriod : options .cpuPeriod ,
136+ CPUQuota : options .cpuQuota ,
137+ CPURealtimePeriod : options .cpuRealtimePeriod ,
138+ CPURealtimeRuntime : options .cpuRealtimeRuntime ,
139+ NanoCPUs : options .cpus .Value (),
140+ PidsLimit : pidsLimit ,
126141 },
127142 RestartPolicy : & restartPolicy ,
128143 }
0 commit comments