docker-library / mongo

Docker Official Image packaging for MongoDB
https://www.mongodb.org/
Apache License 2.0
1.03k stars 619 forks source link

Add missing dll for 8.0.0-rc8 nanoserver #698

Closed yosifkit closed 3 months ago

yosifkit commented 3 months ago

The 8.0.0-rc8 nanoserver images are failing to build:

Step 8/12 : COPY --from=mongo:8.0.0-rc8-windowsservercore-ltsc2022 C:\\mongodb C:\\mongodb
 ---> eb170d31ebdd
Step 9/12 : RUN mongod --version
 ---> Running in e6f3a0d9381c
The command 'cmd /S /C mongod --version' returned a non-zero code: 3221225781

🔍 After searching through the DLLs loaded by mongod.exe at runtime, it turns out that msvcp140_1.dll is needed on nanoserver. We might be missing other DLLs for MongoDB features that aren't loaded when doing mongod --version.

For reference, this is the C:/Windows/System32/ folder from the MongoDB installation layer in the windowsservercore image, though I don't know how many of the DLLs we should move or if the mongo:*nanoserver images are really even used.

d????????? ?/?               0 ????-??-?? ??:?? ..
---------- 0/0           24440 2022-01-05 15:34 msvcp140_1.dll
---------- 0/0           56184 2022-01-05 15:34 msvcp140_atomic_wait.dll
---------- 0/0          316848 2022-01-05 15:34 concrt140.dll
d--------- 0/0               0 2024-06-07 09:20 config
---------- 0/0          571824 2022-01-05 15:34 msvcp140.dll
---------- 0/0           57872 2024-06-12 18:06 FNTCACHE.DAT
---------- 0/0          187304 2022-01-05 15:34 msvcp140_2.dll
d--------- 0/0               0 2024-06-07 16:03 Microsoft
---------- 0/0           20344 2022-01-05 15:34 msvcp140_codecvt_ids.dll
---------- 0/0          336304 2022-01-05 15:34 vccorlib140.dll
---------- 0/0           97656 2022-01-05 15:34 vcruntime140.dll
---------- 0/0           37240 2022-01-05 15:34 vcruntime140_1.dll
d--------- 0/0               0 2021-05-08 08:27 winevt
d--------- 0/0               0 2024-06-07 09:05 LogFiles
tianon commented 3 months ago

Maybe the alternative is that we use 8.0 as the opportunity to deprecate nanoserver instead and that's the cutoff point beyond which we stop maintaining this variant?

whalelines commented 3 months ago

Is there a way to spin it up and exercise the functionality a bit to see if there are any late-loading DLLs?

tianon commented 3 months ago

I recall a long time ago trying to get our mongo-basics test to run on Windows, but it's been a while (and it definitely won't work as-is right now: https://github.com/docker-library/official-images/blob/5a3458bf1f704fa5617e19d21254a72d10b8ee53/test/tests/mongo-basics/run.sh)

yosifkit commented 3 months ago

We should keep MongoDB nanoserver images for now, but I don't see enough users to spend the effort to improve upon them or their testing. It was requested back in 2016 (https://github.com/docker-library/mongo/issues/124) and only added in 2021 (https://github.com/docker-library/mongo/pull/470). If maintaining them becomes a recurring problem, then we can look at automating/testing this list of DLLs or even dropping the nanoserver variants.