浏览代码

docker containers based on defined names

docker container autocomplete listing uses containers ID instead of names.
Most users identify their containers by name. ID is only needed and used on a dynamic environment more suited in scripts.
ctroncoso 9 年之前
父节点
当前提交
68955f17ad
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      plugins/docker/_docker

+ 1 - 1
plugins/docker/_docker

@@ -11,7 +11,7 @@
 # Output a selectable list of all running docker containers
 __docker_containers() {
     declare -a cont_cmd
-    cont_cmd=($(docker ps | awk 'NR>1{print $1":[CON("$1")"$2"("$3")]"}'))
+    cont_cmd=($(docker ps | awk 'NR>1{print $NF":[CON("$1")"$2"("$3")]"}'))
     _describe 'containers' cont_cmd
 }