Compose: cannot unmarshal number

Created on 15 Nov 2016  路  2Comments  路  Source: docker/compose

Version: docker-compose version 1.8.0, build f3628c7

Command: docker-compose -f docker-compose/development.yml run --rm postgres

ERROR: _Cannot create container for service postgres: json: cannot unmarshal number into Go value of type string_

development.yml

version: '2'
services:
  postgres:
    build:
      context: ..
      dockerfile: Docker/Dockerfile-postgres
    image: bet_postgres
    logging:
      options:
        max-size: 50m
        max-file: 2
    ports:
    - "5432:5432"

To avoid error: max-file: "2"

kinquestion

Most helpful comment

Ran into this today. I was adapting a stack to docker-compose for local development.

Docker stack handles the missing quotes without an error, where docker-compose fails to start the service. It would be nice if docker-compose were as reliable.

At the very least, it would be nice to get an error message that provides a specific location or value to help with debugging configuration file.

It would be nice to see this re-opened as a feature request or bug.

All 2 comments

Yeah, logging options can only be strings, so that error makes sense.

Ran into this today. I was adapting a stack to docker-compose for local development.

Docker stack handles the missing quotes without an error, where docker-compose fails to start the service. It would be nice if docker-compose were as reliable.

At the very least, it would be nice to get an error message that provides a specific location or value to help with debugging configuration file.

It would be nice to see this re-opened as a feature request or bug.

Was this page helpful?
0 / 5 - 0 ratings