What does --rm do here?
docker run --rm alpine echo hi
- Removes the alpine image afterwards
- Runs the container with a read-only disk
- Deletes the container when it exits
- Removes any old container with that name
--rm cleans up the container (and its anonymous volumes) once it stops; the image stays in the local cache.
Play DevOps ▸