[英]docker-compose: Unsupported config option for 'runtime'
Recently, I have reinstalled my Ubuntu 20.04 and I am trying to run my docker-compose.yml
using docker-compose up --build
.最近,我重新安装了 Ubuntu 20.04,并尝试使用docker-compose.yml
docker-compose up --build
运行我docker-compose.yml
。 And I am getting following error,我收到以下错误,
ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services.test: 'runtime'
And my docker-compose.yml
is我docker-compose.yml
是
version: '3'
services:
test:
image: nvidia/cuda:11.0-base
command: nvidia-smi
runtime: nvidia
In my previous Ubuntu 20.04 it was working fine, but after new docker installation I am getting this error.在我之前的 Ubuntu 20.04 中它运行良好,但是在新的 docker 安装后我收到了这个错误。 Additionally, I have also installed Nvidia Container Toolkit .此外,我还安装了Nvidia Container Toolkit 。
Furthermore, the command docker run --rm --runtime=nvidia nvidia/cuda:11.0-base nvidia-smi
is also working as expected.此外,命令docker run --rm --runtime=nvidia nvidia/cuda:11.0-base nvidia-smi
也按预期工作。
I appreciate any help to solve this problem.我感谢任何帮助解决这个问题。
Thank you.谢谢你。
This is highly version dependent problem.这是高度依赖于版本的问题。
Most of answers are in thread https://github.com/docker/compose/issues/6239 It seems to work on 1.27 as both v2 and v3 compose syntaxes have been merged, but broke on 1.28 and this undocumented madness unfortunately goes on.大多数答案都在线程https://github.com/docker/compose/issues/6239 中它似乎在 1.27 上工作,因为 v2 和 v3 compose 语法已合并,但在 1.28 上崩溃了,不幸的是这种未记录的疯狂仍在继续。
If you expect it to work with docker-compose, than you should probably stick with version that has been known for working with this feature for now.如果您希望它与 docker-compose 一起使用,那么您可能应该坚持使用目前以使用此功能而闻名的版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.