简体   繁体   English

Docker:b'json:无法将数字解组为Go结构字段LogConfig.Config,类型为string'

[英]Docker: b'json: cannot unmarshal number into Go struct field LogConfig.Config of type string'

I configured my application in docker compose to use rotating logs, following the in the following site: https://medium.com/@Quigley_Ja/rotating-docker-logs-keeping-your-overlay-folder-small-40cfa2155412 我在docker compose中配置我的应用程序以使用旋转日志,遵循以下站点: https//medium.com/@Quigley_Ja/rotating-docker-logs-keeping-your-overlay-folder-small-40cfa2155412

my-app:
image: my-app:latest
logging:
    driver: "json-file"
    options:
        max-file: 5
        max-size: 10m

But when I run the program now it cannot start with the following error: b'json: cannot unmarshal number into Go struct field LogConfig.Config of type string' 但是当我现在运行该程序时,它无法启动以下错误:b'json:无法将数字解组为Go结构字段LogConfig.Config类型为字符串'

Turns out I had to put " " around the values: 结果我不得不在值周围加上“”:

my-app:
image: my-app:latest
logging:
    driver: "json-file"
    options:
        max-file: "5"
        max-size: "10m"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 json:无法将数字解组为 Go 结构字段。字符串类型的数量 - json: cannot unmarshal number into Go struct field .Amount of type string 松露测试:ProviderError: json: cannot unmarshal number into Go struct field params.fromBlock of type string - Truffle test: ProviderError: json: cannot unmarshal number into Go struct field params.fromBlock of type string json:无法将字符串解组为 main.CaseReport 类型的 Go struct field.result.case_report - json: cannot unmarshal string into Go struct field .result.case_report of type main.CaseReport 无法将 JSON 字符串解组为 Go 中的结构 - Cannot Unmarshal JSON String to struct in Go 无法将字符串解组到Go结构字段中 - cannot unmarshal string into Go struct field 使用运行命令执行 SSM 文档失败 json:无法将数组解组为 Go 结构字段 RunScriptPluginInput.RunCommand 类型为 string\" - SSM document execution using run command failed json: cannot unmarshal array into Go struct field RunScriptPluginInput.RunCommand of type string\" 无法将字符串解组到类型模型的Go struct字段Article.article_type中。 - cannot unmarshal string into Go struct field Article.article_type of type models.ArticleType json:无法将 object 解组为 []*main.Config 类型的 Go 值 - json: cannot unmarshal object into Go value of type []*main.Config json:无法将字符串解组为main.test_struct类型的Go值 - json: cannot unmarshal string into Go value of type main.test_struct json:无法将数字 5088060241 解组为 int 类型的结构 - json: cannot unmarshal number 5088060241 into struct of type int
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM