docker / go-units

Parse and print size and time units in human-readable format
https://godoc.org/github.com/docker/go-units
Apache License 2.0
218 stars 38 forks source link

`docker run -m 100MB` while `docker stats` show a limit of 104.9 MB #13

Closed allencloud closed 8 years ago

allencloud commented 8 years ago

related to https://github.com/docker/docker/issues/21765

In docker master, docker uses go-unit to traslate 100MB in to bytes: https://github.com/docker/docker/blob/master/runconfig/opts/parse.go#L163

As a result, 100MB input is dealed with use of RAMInBytes, it becomes 100MiB=104857600=104.9MB. I think this will confuse user.

And what confuses me is that does RAMInBytes have some special meanings? People's 1MB in RAM means 1024_1024_1024 bytes=1MiB?