
ショコラ
起動中のコンテナを削除するには?
「docker rm -f {コンテナ名}」をキメマス。

もっさん先輩
docker rm -f {コンテナ名}
例
docker rm -f httpd
シチュエーション
起動中のコンテナを削除したらエラーになった。
- コンテナを起動します。
docker run --name=httpd httpd
- コンテナを削除します。
docker rm httpd
コンテナを止めていないと、エラーになります。
Error response from daemon: You cannot remove a running container {コンテナID}. Stop the container before attempting removal or force remove