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

docker/docker-compose.yaml : Add fix for mongodb container on WSL #45

Merged
merged 1 commit into from
Dec 15, 2021

Conversation

JenySadadia
Copy link
Collaborator

Added docker volume for mongodb.
Signed-off-by: Jeny Sadadia jeny.sadadia@gmail.com

@gctucker
Copy link
Contributor

gctucker commented Dec 7, 2021

Tip: If you add something like "Fixes #43" in the PR description it should automatically link it with the issue.

@gctucker gctucker linked an issue Dec 7, 2021 that may be closed by this pull request
@JenySadadia
Copy link
Collaborator Author

Tip: If you add something like "Fixes #43" in the PR description it should automatically link it with the issue.

Thanks for the tip. I will use that from now onwards :)

@gctucker
Copy link
Contributor

I'm hitting this error:

Successfully built dd4ee458c5d7
Successfully tagged docker_api:latest
Creating kernelci-db      ... error
Creating kernelci-redis ... 
Creating kernelci-api   ... 
Creating kernelci-storage ... 
Creating kernelci-redis   ... done
Creating kernelci-api     ... done
Creating kernelci-storage ... done

ERROR: for db1  Cannot create container for service db1: Conflict. The container name "/kernelci-db" is already in use by container "4d3cd3ea6adb23a9efb5be0cc7d189857936edfc8e5b879608fc0c8b5d79e409". You have to remove (or rename) that container to be able to reuse that name.
ERROR: Encountered errors while bringing up the project.

Maybe it's just a problem with my local setup, I'll try again from a clean setup but still it would be interesting to understand why this is happening.

@gctucker
Copy link
Contributor

OK I just had to remove an old stale container. For some reason it wasn't a problem with the volume using a bind-mounted directory.

@@ -17,11 +17,11 @@ services:
env_file:
- ../.env

db:
db1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this renamed to db1? I think it should be OK to leave it as db.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hit the same issue of ERROR: for db Cannot create container for service db: Conflict. The container name "/kernelci-db" is already in use. So I tried to rename the service to db1 and check.
It was for testing only.
Yes, we don't need to rename the service name.

@gctucker
Copy link
Contributor

I renamed the service back to db and got this to work fine locally. Of course this created a new empty Mongo database but that's normal since it's a different Docker volume (it's possible to transfer the data if needed, for example using mongodump / mongorestore).

Signed-off-by: Jeny Sadadia <jeny.sadadia@gmail.com>
@JenySadadia
Copy link
Collaborator Author

I renamed the service back to db and got this to work fine locally. Of course this created a new empty Mongo database but that's normal since it's a different Docker volume (it's possible to transfer the data if needed, for example using mongodump / mongorestore).

Okay. I pushed the changes with 'db' service name.

Copy link
Contributor

@gctucker gctucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested OK locally using kernelci-pipeline.

@gctucker gctucker merged commit db81f32 into kernelci:main Dec 15, 2021
@JenySadadia JenySadadia deleted the mongodb-wsl branch December 28, 2021 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Mongodb docker container issue on WSL
2 participants