docker run -ti image
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker exec -ti CONTAINER_ID bash
docker exec -ti $(docker ps -q |head -n1) bash
docker run -ti image
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker exec -ti CONTAINER_ID bash
docker exec -ti $(docker ps -q |head -n1) bash
won't work. The -q option would relate to quitting an image. The correct formate to remove all images consecutively would be the following:
which would remove all images - the force option would just be an added measure if a container is being used or "dependent" on another image and/ or process. It also compounds the command to stop and remove all images which remove the need for the first command. - Thanks for the free resource