dockers compose up 报no configuration file provided: not found

如果docker-compose文件不在当前路径的下一级:

go 复制代码
PS D:\code\GoLandProject\oneProject> docker compose up
no configuration file provided: not found

需要指定配置文件路径:

go 复制代码
PS D:\code\GoLandProject\oneProject> docker compose -f script/docker-compose.yaml up
[+] Running 1/1
 ✔ Container script-mysql8-1  Recreated                                                        

或者直接在例子中的script目录执行

go 复制代码
PS D:\code\GoLandProject\oneProject\script> docker compose up                              
[+] Running 1/0
 ✔ Container script-mysql8-1  Created          

看到ready for connections.即为成功

go 复制代码
[Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.29'  socket: '/va
r/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
相关推荐
A心有千千结21 分钟前
GO 使用 OpenTelemetry 进行编译时插桩,实现零码注入
数据库·golang·可观测性·观测云
金金计较.19 小时前
Go语言-3
java·开发语言·golang
名字还没想好☜1 天前
Go 用 json.Decoder 流式解析大 JSON:边读边处理不爆内存
开发语言·后端·golang·go·json
皓月盈江1 天前
Linux系统使用VSCode搭建GO开发环境
linux·vscode·ubuntu·golang·debian
小羊在睡觉2 天前
HLS视频
linux·后端·golang
金金计较.2 天前
Go语言-2
开发语言·算法·golang
平头哥AI3 天前
Day 22 _ 包装错误别丢链_%w、errors.Is 与 errors.As
android·服务器·学习·golang·go