7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Docker imageの名前だけを一覧する

Last updated at Posted at 2014-07-09

持ち歩きのPCをWindows7からUbuntuに入れ替へました。

問題

入れてるDockerのimage名が長く成って覚えてないし、コピペしやうにもdocker ps -aの出力は長い。名前だけ一覧したい。

解決

AWKを使ふ。.bashrcに書く。

function docker-ps-names() {
  docker ps -a | awk -F"  +" 'NR>1{print $(NF-1)}'
}

空白区切りで、ヘッダである一行目を飛ばし、最後の列を出力する。
peco ( https://github.com/peco/peco ) と一緒に使ふ。

docker start -a $(docker-ps-names | peco)

Unite.vimみたいでpecoしゅごい (pecoの宣伝)。

-> http://c4se.hatenablog.com/entry/2014/07/07/192616

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?