`docker rmi` - image is being used by stopped container

I’m trying to delete the most recent docker image.

alpine:~# docker images
REPOSITORY                TAG        IMAGE ID       CREATED          SIZE
chrisk                    built_vi   aee7ee967988   51 minutes ago   1.35GB
chrisk/micropython        built      b3bd6ff2cd24   10 hours ago     1.34GB
scrlk/esp32-micropython   latest     2c53d2145141   4 years ago      1.26GB
alpine:~# docker rmi aee7ee967988
Error response from daemon: conflict: unable to delete aee7ee967988 (must be forced) - image is being used by stopped container 6ab43bc6dd0c
alpine:~# 

What is a stopped container? And why do I not see it?

OK, further research revealed:

docker ps -a

But in the end I did a docker rmi --force

But I still have a lot of such:

CONTAINER ID   IMAGE                     COMMAND                CREATED             STATUS                         PORTS     NAMES
6ab43bc6dd0c   aee7ee967988              "bash"                 About an hour ago   Exited (0) About an hour ago             trusting_yalow
1dfd160f2b45   b3bd6ff2cd24              "bash"                 About an hour ago   Exited (0) About an hour ago             recursing_moser
a883e7b7a713   b3bd6ff2cd24              "bash"                 About an hour ago   Exited (0) About an hour ago             sleepy_bell
85f0c430c1ae   b3bd6ff2cd24              "bash"                 About an hour ago   Exited (0) About an hour ago             wonderful_einstein
fba454692426   b3bd6ff2cd24              "bash"                 10 hours ago        Exited (0) 10 hours ago                  laughing_satoshi
2c216812fd87   b3bd6ff2cd24              "bash"                 10 hours ago        Exited (0) 10 hours ago                  great_noether
a17936326ba8   b3bd6ff2cd24              "bash"                 10 hours ago        Exited (0) 10 hours ago                  relaxed_hoover
162014b2743f   2c53d2145141              "bash"                 11 hours ago        Exited (0) 10 hours ago                  exciting_sanderson
3ad832f49e4a   2c53d2145141              "bash"                 11 hours ago        Exited (0) 11 hours ago                  agitated_haslett
1f59e0c420be   2c53d2145141              "bash"                 11 hours ago        Exited (0) 11 hours ago                  fervent_ritchie
cee2d9633f8a   2c53d2145141              "bash"                 11 hours ago        Exited (0) 11 hours ago                  nifty_chatterjee
c099daaaaab5   scrlk/esp32-micropython   "/micropython/build"   12 hours ago        Exited (0) 12 hours ago                  nervous_goldberg
df7801de2f0a   scrlk/esp32-micropython   "/micropython/build"   12 hours ago        Exited (0) 12 hours ago                  optimistic_taussig

Why does this all pile up?

You probably ran containers like docker run -it bash, exited and left the container stopped. Containers are not deleted automatically unless you use --rm like docker run --rm -it bash. docker container prune removes these stopped containers.