Is it better to start an existing Docker container or always run a new one (and manually remove the old ones)?

What would be the most friendly solution for CI/CD and automated workflows? Always forcing a new run would mean we always use the latest image, but it creates additional work in terms of having to remove the old, inactive containers (especially if they’re named the same).

Would always running a new container and not naming it, and then periodically cleaning everything with docker container prune be the way to go? I’m looking for what’s best practice.

Source: Docker Questions

LEAVE A COMMENT