I have docker-compose.yml file with configuration of my application.
One of the services needs access to the GPU.
I built the container separately and using the command docker run -it --gpus=all <my_image> /bin/bash quite simply started everything.
But I need to start this service with GPU access using docker-compose.
Version of my docker-compose.yml - 3.7
And if I use the code examples from the official documentation, then they do not work, for example these one:
services:
test:
image: tensorflow/tensorflow:latest-gpu
command: python -c "import tensorflow as tf;tf.test.gpu_device_name()"
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
docker-compose throws an error on the keyword reservations
Please tell me how can I give access to the GPU for my service with docker-compose.yml version 3.7