supercharge / mongodb-github-action

Use MongoDB in GitHub Actions
MIT License
222 stars 46 forks source link

Feature Request - Destroy the container at the end of the job #19

Closed pinalbhatt closed 3 years ago

pinalbhatt commented 3 years ago

This is request to add feature to destroy the container at the end of the job.

This may not be needed in case of github runners but we are using self hosted runners and for the first time when this action is called it works fine but when same workflow is executed again we get following error

Starting single-node instance, no replica set
docker: Error response from daemon: Conflict. The container name "/mongodb" is already in use by container "081129fd0a987c3ec386758d0f4b87e3cfbebe868768d44708736539a6179d05". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.

And when i go to the console of the self-hosted runner and run docker ps this docker container running.

marcuspoehls commented 3 years ago

@pinalbhatt Hey Pinal, thank you for reaching out. We’re not using self-hosted runners and didn’t encounter the issue yet.

I found a related issue in the actions/runner repository: https://github.com/actions/runner/issues/926 They have the same problem as you do.

Is it an option for you to use “ephemeral” runners?

marcuspoehls commented 3 years ago

@pinalbhatt Hey Pinal, did you have a chance looking into this on your side?

pinalbhatt commented 3 years ago

hey sorry @marcuspoehls but did not looked into this as I am no more using this action.

marcuspoehls commented 3 years ago

Alright, no worries 😃