The docker engine Removing a running container:
[email protected]:/home/vamshi# docker rm data-container Error response from daemon: You cannot remove a running container e3de85aaf61cb0641280b91772baa3477c896fc32d604d91ad855becf56c507f. Stop the container before attempting removal or force remove
So you have to stop the container first using the below command as its not advised to forcefully evict a running container.
docker stop .
Then run the docker container rm or docker rm command to remove the container.
Although the docker provided a forceful removal process to remove the running container which you can run in special cases where the specific container is not responding due to IO issues or process locks inside the container space.
You have to run the docker rm command with -f option to forcefully remove it.
[email protected]:/home/vamshi# docker rm -f data-container