k8s的学习2–docker常用命令

发布于 2021-03-04  962 次阅读


报错:

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

原因是有两个Cmd

[root@10.21.214.222 ~]# docker image inspect nginx | grep Cmd
"Cmd": [
"Cmd": [

解决:

docker image inspect nginx  ##查看她的上一层是什么,然后组合
[root@10.21.214.222 ~]# docker image inspect -f {{.ContainerConfig.Cmd}} nginx  
[/bin/sh -c #(nop)  CMD ["nginx" "-g" "daemon off;"]]
[root@10.21.214.222 ~]# docker image inspect -f {{.Config.Cmd}} nginx          
[nginx -g daemon off;]