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.
相关推荐
2501_9318037515 小时前
Go:一门为解决C语言痛点而生的现代语言
c语言·开发语言·golang
geovindu15 小时前
go: Interpreter Pattern
开发语言·设计模式·golang·解释器模式
平凡但不平庸的码农20 小时前
Go Channel详解
开发语言·后端·golang
子安柠20 小时前
深入理解 Go 语言文件操作:从基础到最佳实践
开发语言·后端·golang
Achou.Wang20 小时前
go语言中使用等待组(waitgroups)和内存屏障(barriers)进行同步
开发语言·后端·golang
金玉满堂@bj1 天前
Go 语言能做什么?
开发语言·后端·golang
geovindu1 天前
go:Condition Variable Pattern
开发语言·后端·设计模式·golang·条件变量模式
金玉满堂@bj1 天前
Gin 框架零基础全套入门教程(Go 企业级 Web 开发)
前端·golang·gin
jieyucx1 天前
Go语言深度解剖:Map扩容机制全解析(增量扩容+等量扩容+渐进式迁移)
开发语言·后端·golang·map·扩容策略
王码码20351 天前
Go语言的内存管理:原理与实战
后端·golang·go·接口