DockStation / dockstation

DockStation is developer-centric application to managing projects based on Docker. Instead of lots of CLI commands you can monitor, configure, and manage services and containers using just a GUI.
https://dockstation.io/
2.14k stars 106 forks source link

Imported project with container-name option doesn't work correct #201

Open igor-lemon opened 5 years ago

igor-lemon commented 5 years ago

We have some docker-compose config which has container-name param. After import project into DockStation, I have an error.

ERROR: some-container  Cannot create container for service mongo: Conflict. The container name "/some-container" is already in use by container "f540227f2f582abf0e671eb8b732d5b472e55f8159a3b6c36dd7af2f4c014195". You have to remove (or rename) that container to be able to reuse that name.

The problem: We create .env file in the project directory with COMPOSE_PROJECT_NAME param. Docker tries to recreate the container because Compose sees another project name. But we have the container with this name already.

The solution: Don't create .env file. Before create need to check a unique project directory name or .env file exists. If a user doesn't have .env file with COMPOSE_PROJECT_NAME param and directory of project isn't a unique need to notify about the possibility of incorrect work.

Related issues: https://github.com/DockStation/dockstation/issues/108 https://github.com/docker/compose/issues/745