4
2

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,docker-composeでちょっと使うコマンド

Last updated at Posted at 2019-08-16

dockerで今あるやつみる

docker ps -a
docker images

docker-compose buildが反映されてないっぽいとき

docker-compose build --no-cache

全部消したいとき

container全削除

-fをつけたら強制的になる

docker rm `docker ps -a -q`

image全削除

-fをつけたら強制的になる

docker rmi `docker images -q`

全部は消したくない系

例えば、今日の作業分全部いらないなってときに

dockerで今日のcontainer全部消す

-fをつけたら強制的になる

docker rm `docker ps -a | grep -E "minutes?|hours?" | awk '{print $1}'`

dockerで今日のimage全部消す

-fをつけたら強制的になる

docker rmi `docker images | grep -E "minutes?|hours?" | awk '{print $3}'`
4
2
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
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?