According to docker docs, using --rm or --force-rm is supposed to cleanup intermediate images (as part of docker build). However, this never works.
This is my dockerfile
FROM postgres:latest
COPY .sql,.csv /tmp
CMD postgres
This resulted into 3 additional images. The issue here is that it’s a misleading theory that intermediate images are removed. This is also unavoidable when you try to do a commit of a running image.
Also, this means the Host disk space will run out faster than anticipated. Has anyone gone around this somehow?