Closed sig-piskule closed 11 months ago
Partial resolution discovered by switching Docker Desktop to use gRPC Fuse under General -> Choose file sharing implementation for your containers.
Yes, currently there is no way to overwrite the db path for the mongod instance created, and we assign a temporary folder. We can add that option.
Describe the bug I have a complicated CLI docker container that I share with my developers. In it, I have created a kubernetes plugin,
kubectl query
which allows us to load internal data into an in-memory and search it. It works great and as expected when running on MacOS.When packaged and launched our docker container, we mount the
/tmp
directory as a method of porting data inbetween the Mac and the Ubuntu container. This allows us to easily transfer our scratch data between the OS in Ubuntu and Mac. This is often used for other kubectl plugins that we have written.The fact that we are mounting the
/tmp
directory is not playing well withpymongo_inmemory
. I have discovered that if we opt not to mount the/tmp
directory, thenpymongo_inmemory
correctly starts. Only when we mount the/tmp
directory, doespymongo_inmemory
fail to connect. This is reproducible with the code below.I have attempted furthermore to bypass this issue by setting the
TMPDIR
,TEMP
, andTMP
directories, so that thetempfile
package ignores the volume mounting. However, I am still exhibiting this problem.To Reproduce Steps to reproduce the behavior:
Full Error
Expected behavior I was expecting successful startup of Mongo DB:
In the event that MongoDB can't share the
/tmp
directory with MacOS, I was expectingTMPDIR
to get the system working. NOTE:pymongo_inmemory
is respecting theTMPDIR
environment variable, it just isn't starting Mongodb, and I'm not sure why.Logs See above error.
Screenshots N/A
Context:
Workarounds instead of direct fixes are acceptable to me.