Skip to content

Instantly share code, notes, and snippets.

@ebith
Created June 11, 2016 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebith/62a8db3a43e57567106c2eb78235e7cb to your computer and use it in GitHub Desktop.
Save ebith/62a8db3a43e57567106c2eb78235e7cb to your computer and use it in GitHub Desktop.

Docker Cheatsheet

Commands

イメージを起動する C-p C-qでデタッチ

docker run --interactive --tty IMAGE

デーモンモードで起動する

docker run --detach --interactive --tty IMAGE

ホストのディレクトリをコンテナにマウントして起動する

docker run --volume=/tmp:/tmp --interactive --tty IMAGE

メモリを制限して起動する

docker run --memory=128m --interactive --tty IMAGE

起動中のコンテナにシェルで入る

docker exec -it CONTAINER sh

停止中のコンテナを削除

docker rm $(docker ps -a -q)

古いイメージを削除

docker rmi $(docker images | awk '/^<none>/ { print $3 }')

Pages

Docker の Data Volume まわりを整理する - Qiita

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment