Docker container not being removed when using an alias

25 Views Asked by At

I have a django cookie cutter with docker project and the cli prefix for executing commands is docker compose -f docker-compose.yml run --rm django python manage.py. As you can see this is very long so I created a .zshrc alias for this.

For some reason when I run the alias for this command, the container is created, run and exited but not removed from docker desktop. If I run it straight in the terminal, it does the same but the container is removed this time. Any one know why this is or if I can fix this? I don't want to have to type out this super long command, but I also don't want to have to keep deleting dangling containers.

0

There are 0 best solutions below