'What is -rm used in docker build for? [duplicate]

So when I use

docker build -f Dockerfile -t test_1 .

I create an image that can be ran with docker run. But what is the point of using --rm in docker build .? Isn't the image being eliminated?



Solution 1:[1]

Based on trial for --rm in docker build is working to automatically delete/destroy the container after process stop. Also can be check with command docker ps -a

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Chris