daemon.json type mismatch: json-file driver opt `max-file` expects string, not integer
File: config/containers/logging/json-file.md, CC @johndmulhausen
Under Options, row max-file, description states:
A positive integer.
This is a misrepresentation. If you use a positive integer in the daemon.json, the dockerd service will output the following error:
cannot unmarshal number into Go value of type string
Not sure if it is particular to this json-file configuration or of it common in common throughout the daemon.json configuration, but it should be stated somewhere that it expects a type of string of an integer.
Looks like the docs are wrong. Looking at the source, the driver options are string=string.
The tests, also confirm that.
The docs describe " A positive integer plus a modifier representing the unit of measure (k, m, or g)", which looks correct to me, although perhaps a bit difficult to grasp
@thaJeztah it's the max-file option, not max-size.
I was about to make the same mistake when writing my original reply 😂
oh! you're right, exactly how I got there.
Hm, so, yes, thinking how this should be documented. The issue here is that the "logging-driver options" are a generic way to pass options to the driver, for which strings are used.
The intent was to describe that (on the comandline) a numeric value is expected (the shell doesn't really care about integers or strings that respect). Some extra examples for the daemon.json could be useful likely
Sorry about the confusion in the title that I too got wrapped up in... m(_ _)m
Closing this ticket due to its age, and the impending refactor. If you think this is in error, feel free to reopen. Thanks!
Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.
If you have found a problem that seems similar to this, please open a new issue.
/lifecycle locked