Docker 数据卷查看 映射的目录出错(Template parsing error: template: :1:2: executing "" at <.Volumes>: map has no)
2017-03-29 00:19
1301 查看
报错:
[root@ops-ip-statistic ~]# docker inspect -f {{.Volumes}} volume-test1 Template parsing error: template: :1:2: executing "" at <.Volumes>: map has no entry for key "Volumes"
解决:
1,使用 “.Config.Volumes” 替换 “.Volumes”[root@ops-ip-statistic ~]# docker inspect -f {{.Config.Volumes}} volume-test1 map[/data:{}]
显示为空,此法 在此不可行
2,直接看容器的所有信息 再grep
[root@ops-ip-statistic _data]# docker inspect volume-test1 | grep Mounts -A 10 "Mounts": [ { "Name": "0a3d70900bd0fa46c797f7aa7ff5176b7f6a5a798b6a282cd6c532facfd24925", "Source": "/var/lib/docker/volumes/0a3d70900bd0fa46c797f7aa7ff5176b7f6a5a798b6a282cd6c532facfd24925/_data", "Destination": "/data", "Driver": "local", "Mode": "", "RW": true, "Propagation": "" } ],
找到对应的目录是:
/var/lib/docker/volumes/0a3d70900bd0fa46c797f7aa7ff5176b7f6a5a798b6a282cd6c532facfd24925/_data
进入容器中创建一个文件:
[root@nginx data]# echo 123 >a [root@nginx data]# cat a 123
在宿主机的对应的目录中查看:
[root@ops-ip-statistic _data]# cd /var/lib/docker/volumes/0a3d70900bd0fa46c797f7aa7ff5176b7f6a5a798b6a282cd6c532facfd24925/_data [root@ops-ip-statistic _data]# cat a 123
可行!
相关文章推荐
- 当使用JQuery的"$",抛异常Uncaught TypeError: Object #<Object> has no method 'ajax'
- Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "</url-pattern>" 终止
- 出现TypeError: Object #<Object> has no method 'createClient' 错误
- TypeError: Object #<Object> has no method 'createClient'
- Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "</url-pattern>" 终止
- Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named
- When I write #include <qdom.h> it gives error "no such file or directory".
- ActiveRecord::Fixture::FixtureError: table "users" has no column named "activated_at".
- velecity报错:Caused by: org.apache.velocity.exception.ParseErrorException: Lexical error, Encountered: <EOF> after : "\'/order/pay?activity=\" + activityId);\r\n }*/\r\n</script>\r\n#end\r\n" at /a
- exception ‘PHPExcel_Calculation_Exception‘ with message ‘粉丝数据!C2679 -> Formula Error: Operator ‘=‘ has no operands
- Uncaught TypeError: Object #<Object> has no method 'addEvents'
- Docker删除images报错 Error: No such image: 或 删除<none> 镜像 的解决方法
- Uncaught TypeError: Object #<Object> has no method 'addEvents'
- Uncaught TypeError: Object #<Object> has no method 'addEvents' ext-all-debug异常
- Uncaught TypeError: Object #<HTMLDivElement> has no method 'attr'
- Uncaught TypeError: Object #<HTMLCollection> has no method 'toLowerCase'问题
- TypeError: Object #<IncomingMessage> has no method 'flash'
- Uncaught TypeError: Object #<Object> has no method 'fancybox'
- Uncaught TypeError: Object #<Document> has no method 'load'
- EF 新增数据时提示it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element