docker挂载宿主机文件run命令启动报错
背景
使用docker安装mysql8,docker run 命令提示报错
命令:
docker run -d \
-p 3306:3306 \
-v ~/docker/mysql8/log/mysqld.log:/var/log/mysqld.log \
-e MYSQL_ROOT_PASSWORD=123456 \
--name mysql8 mysql:8.0.36
报错信息
docker: Error response from daemon: 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 "/home/liu/docker/mysql8/log/mysqld.log" to rootfs at "/var/log/mysqld.log": mount /home/liu/docker/mysql8/log/mysqld.log:/var/log/mysqld.log (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying