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

Commit

Permalink
docs(docker): 指定文件格式版本
Browse files Browse the repository at this point in the history
  • Loading branch information
zjZSTU committed Jan 1, 2020
1 parent 160c7e1 commit 298064b
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion docs/docker/docker-compose/Compose版本依赖.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,30 @@ $ docker info | grep -i server | grep -i version

## 应用版本

直接使用最新版本的程序即可,参考[compose releases](https://github.com/docker/compose/releases/)
直接使用最新版本的程序即可,参考[compose releases](https://github.com/docker/compose/releases/)

## 指定版本号

参考:[Compose file versions and upgrading](https://docs.docker.com/compose/compose-file/compose-versioning/)

在编写`docker-compose.yml`文件时需要指定文件格式版本

```
version: "3.7"
services:
web:
build: .
ports:
- "5000:5000"
volumes:
...
...
```

**注意:如果仅指定了主版本号(`3`),没有指定次版本号(`7`),默认添加`0`作为次版本号**

```
version: "3"
# 等价于
version: "3.0"
```

0 comments on commit 298064b

Please sign in to comment.