-
Notifications
You must be signed in to change notification settings - Fork 397
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
Error with MongoDb image & volume mount #322
Comments
Thanks for reporting this. I've tried it with a Windows Server 2016 and it works for me
I can reproduce the problem with a Windows Server 2016, version 1709
Seems like a problem with my rebase approach building a 1709 image. I'll try to remove this Current workaround is building the image directly with some 1709 base images. |
Seems like the And the nanoserver image must be run with This Dockerfile seems to work building and running on a 1709 machine # escape=`
FROM microsoft/windowsservercore:1709 as msi
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ENV MONGO_VERSION 3.4.14
ENV MONGO_DOWNLOAD_URL http://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-${MONGO_VERSION}-signed.msi
ENV MONGO_DOWNLOAD_SHA256 0cb34aecb4ae50680a895ea9ebd1516d28eb1498b47faf63d9f065eb6548fcb9
RUN Write-Host ('Downloading {0} ...' -f $env:MONGO_DOWNLOAD_URL)
RUN Invoke-WebRequest -Uri $env:MONGO_DOWNLOAD_URL -OutFile 'mongodb.msi'
RUN Write-Host ('Verifying sha256 ({0}) ...' -f $env:MONGO_DOWNLOAD_SHA256)
RUN if ((Get-FileHash mongodb.msi -Algorithm sha256).Hash -ne $env:MONGO_DOWNLOAD_SHA256) { `
Write-Host 'FAILED!'; `
exit 1; `
}
RUN Start-Process msiexec.exe -ArgumentList '/i', 'mongodb.msi', '/quiet', '/norestart', 'INSTALLLOCATION=C:\mongodb', 'ADDLOCAL=Server,Client,MonitoringTools,ImportExportTools,MiscellaneousTools' -NoNewWindow -Wait
RUN Remove-Item C:\mongodb\bin\*.pdb
RUN mkdir C:\data\db
FROM microsoft/nanoserver:1709
COPY --from=msi C:\mongodb\ C:\mongodb\
COPY --from=msi C:\windows\system32\msvcp140.dll C:\windows\system32
COPY --from=msi C:\windows\system32\vcruntime140.dll C:\windows\system32
COPY --from=msi C:\data\db\ C:\data\db\
EXPOSE 27017
USER ContainerAdministrator
CMD ["C:\\mongodb\\bin\\mongod.exe"] |
Thanks I'll try building my own image with this Dockerfile. As an aside - I find the build process with Nano Server quite a "hack" now, needing run install in Server Core then copying DLLs and other files around. I know this is not your problem BTW! |
FYI this container worked ok, thanks for your help and thanks for these images you are making available to the community. These have become the defacto images for things like Node and Mongo on Windows so thanks for your efforts |
Thanks for letting me know. And thanks for the kind words :-) |
Played with newer Mongo version in 2016 and rebase tool to shift it to 1803.
See #333 to build the NanoServer image without any I also built it directly on a 1803 machine, but the same error happens mounting a folder with existing MongoDB data files in it. |
@StefanScherer is this still an issue? I am reproducing it quite easy with the official MongoDB image (library/mongo:4.2-windowsservercore-1809) on Windows Server 2019. I am using a docker volume (not a bind mount) and it works fine on fresh volume, but it consistently fails when relaunching the container. This is quite a problem as this can't be used for production as-is if I can't guarantee that the problem won't happen again :'( `2020-02-06T00:19:53.651+0000 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none' ` |
@StefanScherer if you can just confirm if the original issue was solved or not, it would help me see if this is an issue that has been there since forever, or a recent issue similar to this one. I have opened this new issue here: docker-library/mongo#385 I can reproduce this issue very easily and made a simple script to reproduce it: |
When starting the nanoserver MongoDB image with a volume I the container doesn't start and I get a cryptic error
docker run --rm -it --mount source=myvol,target=c:/Data/db stefanscherer/mongo-windows:latest
If I remove the volume mount it starts perfectly OK. I'm seeing this problem locally (Windows 10 - Docker Version 17.12.0-ce-win47 (15139)) and also when running the container in Azure
The text was updated successfully, but these errors were encountered: