谁动了我的数据库!
2022-05-24 15:38
采纳率: 40%
浏览 171

docker 映射不出来目录里的文件

docker映射pika配置文件 映射不到

docker run --name pika  -v pika:/conf -d pikadb/pika
508e19da767a5e3e8f296f33af4d3853654b9b4398a5728798f5a8828729bdd3
[root@aly ~]# ll /var/lib/docker/volumes/pika/_data/
total 0
[root@aly ~]# docker volume inspect pika
[
    {
        "CreatedAt": "2022-05-24T14:29:41+08:00",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "/var/lib/docker/volumes/pika/_data",
        "Name": "pika",
        "Options": {},
        "Scope": "local"
    }
]

使用-v映射也映射不到
[root@aly pika]# docker images
REPOSITORY    TAG       IMAGE ID       CREATED         SIZE
mongo         latest    27dd1be4bed1   3 weeks ago     700MB
mysql         5.7       8aa4b5ffb001   3 weeks ago     462MB
nginx         latest    605c77e624dd   4 months ago    141MB
pikadb/pika   latest    d40374a8fa99   17 months ago   2.17GB
[root@aly pika]# docker run --name pika -v /data/conf:/conf/ -d pikadb/pika
36bc2dfd278c0a27f366e29884ec10e517f6802d5accc899acb5619a6dda47f5
[root@aly pika]# ll /data/conf/
total 0

#容器里文件存在
[root@aly pika]# docker exec -it pika sh
sh-4.2# ls
bin  conf  db  dbsync  entrypoint.sh  log
sh-4.2# ls conf/
pika.conf
sh-4.2# ls db
db0
sh-4.2# ls log/
log_db0  pika.36bc2dfd278c.invalid-user.log.INFO.20220524-073506.1  pika.INFO

想要映射的文件 conf db log

2条回答 默认 最新

相关推荐 更多相似问题