rm in docker code example Example 1: how to remove a docker container docker container rm [container id] Example 2: docker remove container docker system prune