docker 错误

[root@gxz Mysofts]# docker run -p 3310:3306  -v /docker/conf/mysql/mysql8_3310/my.cnf:/etc/mysql/my.cnf -v /docker/mysql/mysql8_3310:/var/lib/mysql -d mysql:8.0 
c396213d537dd084f5b5e876e774b30787a8e0e6144fad7ac34e52ba10f87370
docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\\"/docker/conf/mysql/mysql8_3310/my.cnf\\\" to rootfs \\\"/var/lib/docker/overlay2/52a02bceac6fe6337fffd700d481e5f9e99d79ad3aef9b0e47eb15286b1ba86f/merged\\\" at \\\"/var/lib/docker/overlay2/52a02bceac6fe6337fffd700d481e5f9e99d79ad3aef9b0e47eb15286b1ba86f/merged/etc/mysql/my.cnf\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
 

重装过docker ,重导入镜像也不行,但别的镜像能导能用。说明docker 是有用的

结果 原来是  -v /docker/conf/mysql/mysql8_3310/my.cnf:/etc/mysql/my.cnf -v /docker/mysql/mysql8_3310:/var/lib/mysql 的目录路径写错了,这边正确地址是:/data/dockerconf/mysql/mysql8_3310/my.cnf     /data//docker/mysql/mysql8_3310   

目录写错导致找不到路径而产生上面的错误,感觉报错信息提示意思写得有点偏了。

你可能感兴趣的:(Docker)