【发布时间】:2019-03-15 14:22:36
【问题描述】:
我试图在我的docker-compose.yaml 中使用wait-for-it 来等待mysql 准备好,然后再创建依赖它的服务。这是我的docker-compose.yaml:
version: '3.5'
services:
mysql:
image: mysql:5.6
ports:
- "3307:3306"
networks:
- integration-tests
environment:
- MYSQL_DATABASE=mydb
- MYSQL_USER=root
- MYSQL_ROOT_PASSWORD=mypassword
entrypoint: ./wait-for-it.sh mysql:3306
networks:
integration-tests:
name: integration-tests
尝试使用 docker-compose 运行时出现此错误:
启动 integration-tests_mysql_1 ... 错误
ERROR: for integration-tests_mysql_1 无法启动服务 mysql: OCI 运行时创建失败:container_linux.go:348:启动容器 进程导致“exec:\”./wait-for-it.sh\”:stat ./wait-for-it.sh:否 这样的文件或目录”:未知
错误:对于 mysql 无法启动服务 mysql:OCI 运行时创建 失败:container_linux.go:348:启动容器进程导致 "exec: \"./wait-for-it.sh\": stat ./wait-for-it.sh: 没有这样的文件或 目录”:未知错误:在调出 项目。
wait-for-it.sh 脚本与我的docker-compose.yaml 文件处于同一级别,所以我不明白为什么找不到它。
【问题讨论】:
标签: docker docker-compose