Issue Description
Summary
When a plugin that defines Docker-based microservices is re-imported, the installation process fails with a container name conflict error. This happens because existing containers are not automatically cleaned up or replaced before attempting to start new ones.
Steps to Reproduce
-
Import a plugin with docker-compose services.
-
Re-import the same plugin without manually deleting containers.
-
Observe the error:
Error response from daemon: Conflict. The container name "..." is already in use
Expected Behavior
- Re-importing the same plugin should not fail.
- Existing containers for that plugin should be safely replaced.
- Other plugin containers should remain unaffected.
🛠️ Affected Components
- Plugin service installer
- Docker manager (
build_and_start_docker_service)
This issue is commonly encountered during:
- Plugin development & testing
- Multiple imports of the same plugin
- User reinstallation scenarios