compose icon indicating copy to clipboard operation
compose copied to clipboard

docker-compose file invalid; Unsupported config option 'scale'

Open nated099 opened this issue 6 years ago • 3 comments

I'd like to deploy multiples of the same image using docker-compose, but whenever I use the scale option (via command or in the .yaml) to deploy a scaled image fails due to a less than descriptive error;

The Compose file './docker-compose.yml' is invalid because: err: Unsupported config option for services.fluentd: 'scale'

Context information (for bug reports)

Output of docker-compose version

[root@nkerrtest04 nkerr]# docker-compose -v
docker-compose version 1.26.2, build eefe0d31

Output of docker version

[root@nkerrtest04 nkerr]# docker -v
Docker version 19.03.5, build 633a0ea

Output of docker-compose config (Make sure to add the relevant -f and other flags)

version: '3.4'

services:
 fluentd:
   build: ./fluentd
   volumes:
     - ./fluentd/conf:/fluentd/etc
   restart: always
   scale: 2
   logging:
     options:
       max-size: "200k"
       max-file: "1"

Steps to reproduce the issue

  1. sudo docker-compose up -d --build

Stacktrace / full error message

ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services.fluentd: 'scale'

Additional information

OS: Centos 7

This build does work as long as I remove the 'scale: 2' option. I've also attempted via:


"docker-compose up -d --build --scale fluentd=2" 

with the same results. I've also tried different .yaml versions, 3.4 to 3.8 with the same results.

nated099 avatar Sep 01 '20 20:09 nated099

Hi @nated099!

scale is not supported in v3 compose format. Try to set your compose file version to "2.4" or "2.2". If you really want to use the v3 format, try to set deploy.replicas instead as in https://docs.docker.com/compose/compose-file/#deploy.

We are preparing the release of docker-compose v1.27.0 with support for merged v2/v3 format and, with it, you won't need to specify the version anymore.

aiordache avatar Sep 03 '20 12:09 aiordache

Thanks for the response @aiordache. Using "2.4" works, though I may try the deploy.replicas solution as well.

nated099 avatar Sep 03 '20 14:09 nated099

Hi @nated099!

scale is not supported in v3 compose format. Try to set your compose file version to "2.4" or "2.2". If you really want to use the v3 format, try to set deploy.replicas instead as in https://docs.docker.com/compose/compose-file/#deploy.

We are preparing the release of docker-compose v1.27.0 with support for merged v2/v3 format and, with it, you won't need to specify the version anymore.

worked for me thanks.

Gib-git avatar Feb 12 '22 23:02 Gib-git