报错详情
root@hadoop107 cmp]# docker-compose config -q [root@hadoop107 cmp]# ll 总用量 70192 -rw-r--r--. 1 root root 71865074 9月 24 06:45 docker-boot-0.0.1-SNAPSHOT.jar -rw-r--r--. 1 root root 1014 9月 24 08:26 docker-compose.yml -rw-r--r--. 1 root root 497 9月 24 06:13 Dockerfile [root@hadoop107 cmp]# [root@hadoop107 cmp]# [root@hadoop107 cmp]# docker-compose up -d Creating cmp_mysql_1 ... error Creating cmp_redis_1 ... ERROR: for cmp_mysql_1 Cannot start service mysql: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: u nable to start container process: error during container init: error mounting "/wdh01/mysql/conf/my.cnf" to rootfs at "/etc/my.cnf": mount /wdh01/mysql/conf/my.cnf:/ etc/my.cnf (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified ho Creating cmp_redis_1 ... done ERROR: for mysql Cannot start service mysql: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/wdh01/mysql/conf/my.cnf" to rootfs at "/etc/my.cnf": mount /wdh01/mysql/conf/my.cnf:/etc/my .cnf (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host pat h exists and is the expected type ERROR: Encountered errors while bringing up the project.
原因分析
这里的原因是因为创建的 my.cnf 的时候应该是个文件,而这里却是目录,去改一下即可,前往以下目录
[root@hadoop107 mysql]# cd conf/ [root@hadoop107 conf]# ll 总用量 4 drwxr-xr-x. 2 root root 4096 9月 24 08:26 my.cnf [root@hadoop107 conf]# cat my.cnf/ cat: my.cnf/: 是一个目录 [root@hadoop107 conf]# rm -rf my.cnf/ [root@hadoop107 conf]# touch my.cnf [root@hadoop107 conf]# ll 总用量 0 -rw-r--r--. 1 root root 0 9月 24 20:32 my.cnf
再次执行正常了
标签:my,create,cnf,failed,mysql,root From: https://www.cnblogs.com/wdh01/p/18429970