Skip to content
This repository was archived by the owner on Mar 23, 2021. It is now read-only.

Commit 7f7ef56

Browse files
committed
docs(docker): 更新docker-compose使用缺点
1 parent f281e65 commit 7f7ef56

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed
Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11

22
# 使用docker-compose还是docker run
33

4-
学习了`Docker``Docker Compose`,通过`Dockerfile`文件进行镜像的构建,通过`docker-compose.yml`文件进行容器的运行
4+
学习了`Docker``Docker Compose`,通过`Dockerfile`文件进行镜像的构建,通过`docker-compose.yml`文件进行容器的编排
55

66
在实际操作过程中,`docker-compose`操作的优点很明显
77

8-
优点:
9-
108
1. 通过`docker-compose.yml`文件配置容器启动选项,结构清晰
119
2. 能够实现多容器的管理
1210

13-
不过这种方式存在一个缺陷,那就是**`docker-compose.yml`中仅能使用环境变量,无法操作`shell`命令**
11+
不过`docker-compose`还在不断更新中,存在不少问题:
12+
13+
1.`docker-compose.yml`中仅能使用环境变量,无法操作`shell`命令
1414

1515
比如获取当前用户信息
1616

1717
```
1818
$ id -u
1919
$ id -g
20-
```
20+
```
21+
22+
2. 在语法版本`3.7`中无法设置`NVIDIA`
23+
24+
参考:
25+
26+
[Support for NVIDIA GPUs under Docker Compose #6691](https://github.com/docker/compose/issues/6691)
27+
28+
[docker-compose support #1073](https://github.com/NVIDIA/nvidia-docker/issues/1073)
29+
30+
[NVIDIA Container Toolkit](https://github.com/NVIDIA/nvidia-docker)
31+
32+
>Please note that this native GPU support has not landed in docker-compose yet. Refer to this issue for discussion.

0 commit comments

Comments
 (0)