Template parsing error: template: :1:2: executing at <Volumes>: map has no entry for key "Volume

简介: 版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34173549/article/details/80400454 报错:[root@ops-ip-statistic ~]# docker inspect -f {{.
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34173549/article/details/80400454

报错:

[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
  • 2
  • 3


解决:

1,使用 “.Config.Volumes” 替换 “.Volumes”

[root@ops-ip-statistic ~]# docker inspect -f {{.Config.Volumes}} volume-test1
map[/data:{}]
  • 1
  • 2


显示为空,此法 在此不可行

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": ""
            }
        ],
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

找到对应的目录是:

/var/lib/docker/volumes/0a3d70900bd0fa46c797f7aa7ff5176b7f6a5a798b6a282cd6c532facfd24925/_data
  • 1

进入容器中创建一个文件:

[root@nginx data]# echo 123 >a
[root@nginx data]# cat a 
123
  • 1
  • 2
  • 3

在宿主机的对应的目录中查看:

[root@ops-ip-statistic _data]# cd /var/lib/docker/volumes/0a3d70900bd0fa46c797f7aa7ff5176b7f6a5a798b6a282cd6c532facfd24925/_data
[root@ops-ip-statistic _data]# cat a 
123
  • 1
  • 2
  • 3

可行!

相关文章
|
25天前
Cannot load keys from store: class path resource
Cannot load keys from store: class path resource
15 0
|
2月前
|
Java
No tag [else] defined in tag library imported with prefix [c]] with root cause
No tag [else] defined in tag library imported with prefix [c]] with root cause 错误处理
16 0
【已解决】Error: Element type is invalid: expected a string (for built-in components) or a class/function
Error: Element type is invalid: expected a string (for built-in components) or a class/function
2306 0
【已解决】Error: Element type is invalid: expected a string (for built-in components) or a class/function
|
4月前
|
JavaScript
[Vue warn]_ Avoid using non-primitive value as key, use string_number value instea
[Vue warn]_ Avoid using non-primitive value as key, use string_number value instea
|
8月前
|
JavaScript
vue 渲染列表报错Avoid using non-primitive value as key, use string/number value instead. found in
vue 渲染列表报错Avoid using non-primitive value as key, use string/number value instead. found in
40 0
No injector for custom defined data type的解决办法
No injector for custom defined data type的解决办法
224 0
No injector for custom defined data type的解决办法
Identify the logic how BOL node name is categorized into different object type
Identify the logic how BOL node name is categorized into different object type
108 0
Identify the logic how BOL node name is categorized into different object type
OPA 15 - find existing item by its type.note
Created by Wang, Jerry, last modified on Nov 08, 2015
124 0
OPA 15 - find existing item by its type.note
|
算法
On the Correct and Complete Enumeration of the Core Search Space
在之前的文章中我们讨论了基于graph的DP-based算法,来解决join ordering的枚举问题。 这些DP算法通过join predicate描述的连通性,解决了枚举可能的表组合问题,但join graph本身(即使hypergraph)是无法完整的描述join语义的,因为连通边本身无法描述不同类型的join语义,例如left outer join/semi join/anti join...,因此即使找到了所谓的csg-cmp-pair,也不一定是有效的plan。 这篇paper讨论的就是这个问题,当枚举出一个csg-cmp-pair (S1 o S2),如何判断这是有效的join
374 0
On the Correct and Complete Enumeration of the Core Search Space
|
PHP 开发工具
报错 invalid [default store dir]: /tmp/
php sdk解压以后文件如下   推荐处理方案    1.如果使用支付宝sdk,首先lotusphp_runtime 文件也要一起使用  支付宝现在的php sdk中有lotus框架可以和aop文件   夹放在同一级    2.
833 0