docker编写dockfile遇到的问题:

需要在docker-compose.yml文件下执行命令

docker-compose.yml文件格式的问题

1和2处空2格,3处空1格,4为本地配置文件目录,5为docker容器的目录,version为自己安装的docker-compose版本
使用docker compose查询:

上面这个查询的是错误版本,使用docker-compose up时报错

使用以下命令查询:

Docker Compose的版本号和docker-compose.yml文件的版本号是两个不同的概念。

本文部署的docker-compose.yml的version为3.9
演示的一个项目结构:

上传到centos7中:

进入项目采用
docker compose config -q
检查dockerfile编写中的问题
使用以下命令进行部署:
docker compose up
运行示意图:

Nacos启动完成:

