Why docker container update is not stable?

10/23/2019

I use the command docker container update --cpus 1 target_container to update the setting. But in most cases it not working and response "you must provide one or more flags when using this command", but somethings it working

Any one know the reason?

Some log is like,

$ docker container update --cpus 0.5 target_container
you must provide one or more flags when using this command
$ docker container update --cpus 0.5 target_container
you must provide one or more flags when using this command
$ docker container update --cpus 0.5 target_container
target_container

the docker version is

Client:
 Version:           18.09.7
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        2d0083d
 Built:             Fri Aug 16 14:19:38 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.09.7
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       2d0083d
  Built:            Thu Aug 15 15:12:41 2019
  OS/Arch:          linux/amd64
  Experimental:     false
-- bran
docker
docker-compose
docker-swarm
kubernetes

1 Answer

10/23/2019

The docker update man page includes:

--cpus      API 1.29+

A docker version can show you if your API is equal or above the API 29, which was with Docker 17.05.

For testing, try --cpus=1 or --cpus=0.5, considering the argument is supposed to be "number of CPUs"

As usual with commands including an hyphen: don't copy-paste it, copy it manually.

-- VonC
Source: StackOverflow