Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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'

like image 648
Tudor Avatar asked Mar 01 '19 07:03

Tudor


2 Answers

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"
like image 165
Tudor Avatar answered Nov 17 '22 14:11

Tudor


If anyone has this problem, just update composer to latest version. How to upgrade docker-compose to latest version

like image 1
Capiloky Avatar answered Nov 17 '22 15:11

Capiloky