17
11

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.

設定しておくとなにかと捗るalias集(Docker編)【自分向け備忘録】

Posted at

動作確認済み環境は、zsh

  • docker ps

     alias dps='docker ps'
    
  • docker images

     alias dim='docker images'
    
  • 不要container削除

     alias drm='docker rm $(docker ps -aqf "status=exited") 2> /dev/null'
    
  • 不要image削除

     alias drmi='docker rmi $(docker images -aqf "dangling=true") 2> /dev/null'
    
  • docker-compose

     alias dc='docker-compose'
    
  • docker-composeで特定container起動

    • 引数で、container名と実行コマンド(bashとかshとか)を指定
     alias dcrun='dc run --service-ports'
    
  • docker-composeでcontainer停止&削除

     function dcrm() {
         dc stop $1 && dc rm -f $1
     }
    
17
11
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
17
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?