mac-docker-解决挂载出错的问题

复制代码
docker run -d --name myphp7 --restart=always -p 9002:9002 \
-v /usr/local/docker/php/etc/apt/sources.list:/etc/apt/sources.list \
-v /usr/local/docker/nginx/html:/var/www/html \
-v /usr/local/docker/php/php-fpm.d/my.conf:/usr/local/etc/php-fpm.d/my.conf \
-v /etc/localtime:/etc/localtime \
php:7.3.11-fpm

今天在mac上用docker挂载时,一直报错:

docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/usr/local/docker/php/etc/apt/sources.list" to rootfs at "/etc/apt/sources.list": mount /usr/local/docker/php/etc/apt/sources.list:/etc/apt/sources.list (via /proc/self/fd/14), flags: 0x5000: 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.

解决:

把你要挂载的父级目录对应放到 File Sharing 底下,重启后,再次挂载,就正常了(mac下有这个问题,linux下正常)

相关推荐
小Wang2 小时前
npm私有库创建(docker+verdaccio)
前端·docker·npm
容器魔方2 天前
Bloomberg 正式加入 Karmada 用户组!
云原生·容器·云计算
小溪彼岸2 天前
macOS自带截图命令ScreenCapture
macos
muyun28002 天前
Docker 下部署 Elasticsearch 8 并集成 Kibana 和 IK 分词器
elasticsearch·docker·容器
Nazi62 天前
k8s的dashboard
云原生·容器·kubernetes
TESmart碲视2 天前
Mac 真正多显示器支持:TESmart USB-C KVM(搭载 DisplayLink 技术)如何实现
macos·计算机外设·电脑
傻傻虎虎2 天前
【Docker】常用帮忙、镜像、容器、其他命令合集(2)
运维·docker·容器
是小崔啊2 天前
叩丁狼K8s - 概念篇
云原生·容器·kubernetes
2401_897930063 天前
使用Docker轻松部署Neo4j图数据库
数据库·docker·neo4j
2501_915106323 天前
Xcode 上传 ipa 全流程详解 App Store 上架流程、uni-app 生成 ipa 文件上传与审核指南
android·macos·ios·小程序·uni-app·iphone·xcode