I created an image in docker. Installed Ubuntu, JDK in it and couple of other libraries. Then I exited the container and did a commit like this
docker commit a7b95082f6ea anil-ubuntu
I started the container again
docker run -p 5901:5901 -t -i anil-ubuntu
This time I installed gradle and couple of other libraries. And then exited the container and did a commit again.
docker commit a7b95082f6ea anil-ubuntu
Every time I do a commit a new image is created and older images with repository and tag remain. Very soon by following this workflow, I'll run out of space. Is this the right way of using docker ? How do I ensure that all these images go away.
I am using docker version 18.09.1 desktop on windows 10