1. docker 컨테이너의 id 만 전체 출력
$ docker ps -qa
1357fd8e7ed2
9f85ba573af7
2. 출력한 id 의 컨테이너 전체 삭제
$ docker rm -f $(docker ps -qa)
1357fd8e7ed2
9f85ba573af7
3. docker 이미지의 id 만 전체 출력
$ docker images -q
f686a76a6e1c
b5d7662188e5
4475769c9d8b
4. docker 이미지 전체 삭제
$ docker rmi $(docker images -q)
Untagged: go-mongodb-exam-web:latest
Deleted: sha256:896c8003e43ceb723a6f76590fd0237384130fe7e17e034ebdcdc09ffdb7430b
Deleted: sha256:38d35922d480d77e8cd6cdad21e1c050430cdf56de4712f21b67a31c5401321c
Untagged: cosmtrek/air:latest
Deleted: sha256:8e420b54be0044b4f941690411a301fe1599e05c2a8b33dd6fb4d212ff4a5ab8
Untagged: go-mongodb-exam-fiber:latest
Deleted: sha256:0b67462b6f13c2862b5780ebec58224be432fb0cac9e0a3b06dc4273ba09afa9
Untagged: go-mongodb-exam-server:latest
...
...
...