Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker Compose Include option: (root) Additional property include is not allowed

I am trying to implement the include feature described in the Docker Compose documentation: https://docs.docker.com/compose/compose-file/14-include/ but am receiving an error:

(root) Additional property include is not allowed

Has anyone come across this problem and/or know a fix for it?

PC Details:

  • ProductName: macOS
  • ProductVersion: 13.4.1
  • BuildVersion: 22F82

Docker Details:

  • Installed via Rancher Desktop
  • Docker version 24.0.2-rd, build e63f5fa
  • Docker Compose version v2.18.1

Commands:

  • docker compose build

  • docker compose up --build

  • etc.

Example:

# compose.yml

version: '3.8'

include:
  - ./commmon/compose.yml

services:
  serviceA:
    build: .
    depends_on:
      - serviceB

And the other compose file exists with its defined serviceB

I have tried all of the syntax options (although with that error, it just doesn't accept 'include' as a root option). I tried docker compose ... as well as docker-compose ... with no difference.

like image 758
Ryan Avatar asked Sep 02 '26 17:09

Ryan


1 Answers

According to these change notes, include was added in compose 2.20.

like image 63
Hans Kilian Avatar answered Sep 04 '26 07:09

Hans Kilian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!