Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent issues with duplicate service names and orphaned containers #12

Open
1 of 2 tasks
stefandesu opened this issue Sep 26, 2024 · 1 comment
Open
1 of 2 tasks
Labels
enhancement New feature or request

Comments

@stefandesu
Copy link
Member

stefandesu commented Sep 26, 2024

There have been issues in the past when either an existing container was renamed, or a new service was added accidentally with the same name as an existing container.

In the former case, the container with the previous name will continue to run and cause issues with the proxy.

In the latter case, there are now two containers running with the same name, also causing proxy and other issues. And after fixing this (= renaming the new container), we will have the former case, where the previous container is still running.

I would like to implement two fixes:

  • Refuse to start a service that has the same container name as an existing service.
  • Stop and remove orphaned containers (i.e. previous containers that we renamed and restarted under a new name).

This should prevent most issues of having to manually fiddle with Docker commands.

@stefandesu
Copy link
Member Author

Orphaned containers are now removed on start/restart.

Currently, it will still allow duplicate service names to exist, but 1) I added a check script in ./src/check.ts which checks for this specifically, and 2) this check script is now run in GitHub Actions and will fail if there are duplicates. (Ideally, you'd check this before committing though.)

I will leave this issue open because further improvements would be good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant