Docker Community Forums

Share and learn in the Docker community.

Compose file is invalid because ... Additional properties are not allowed

Hi everyone!

I’m still figuring out how Docker works. I followed a tutorial to set up jupyterlab with gpu support and ran into an issue. Since I did not get a reply from the authors, I’m looking for help here too. After running
“./start-local.sh -p 8848”
I get an error:
The Compose file ‘./docker-compose.yml’ is invalid because:
services.gpu-jupyter.deploy.resources.reservations value Additional properties are not allowed (‘devices’ was unexpected)

My docker-compose.yml looks like this:
version: “3.8”
services:
gpu-jupyter:
build: .build
deploy:
resources:
reservations:
devices:
- capabilities:
- gpu
ports:
- 8848:8888
volumes:
- ./data:/home/jovyan/work
environment:
GRANT_SUDO: “yes”
JUPYTER_ENABLE_LAB: “yes”
NB_UID: {UID} NB_GID: {GID}
# enable sudo permissions
user:
“root”
restart: always

OS Ubuntu 18.04.
docker-compose version 1.26.2, build unknown
docker-py version: 4.2.2
CPython version: 3.6.9
OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
I’m not sure what further information should I give.

Thanks in advance for any suggestion on solving the issue.