LoginSignup
3
3

More than 5 years have passed since last update.

[シェルスクリプト]dockerのimageを更新し、不要なimageを削除する

Last updated at Posted at 2016-01-16

docker pullしてimageを更新し、結果として山ほどできるnoneなimageを削除するのが面倒くさいのでシェルスクリプトにした。

upimage.sh
#!/bin/sh

echo "Updating docker images..."
docker images | grep -v REPO | cut -f1 -d" " | uniq | xargs -n1 docker pull
echo "removing obsoleted images..."
docker images -f dangling=true -q | docker rmi
3
3
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
3
3