diff --git a/3.6/windows/windowsservercore-1809/Dockerfile b/3.6/windows/windowsservercore-1809/Dockerfile index 2858395e23..f3e0ba44e4 100644 --- a/3.6/windows/windowsservercore-1809/Dockerfile +++ b/3.6/windows/windowsservercore-1809/Dockerfile @@ -26,9 +26,15 @@ RUN Write-Host ('Downloading {0} ...' -f $env:MONGO_DOWNLOAD_URL); \ 'mongo.msi', \ '/quiet', \ '/qn', \ + '/l*v', 'install.log', \ +# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows-unattended/#run-the-windows-installer-from-the-windows-command-interpreter 'INSTALLLOCATION=C:\mongodb', \ - 'ADDLOCAL=all' \ + 'ADDLOCAL=Server,Client,Router,MiscellaneousTools,MonitoringTools,ImportExportTools' \ ); \ + \ +# Get-Content install.log; \ + Remove-Item install.log; \ + \ $env:PATH = 'C:\mongodb\bin;' + $env:PATH; \ [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ \ diff --git a/3.6/windows/windowsservercore-ltsc2016/Dockerfile b/3.6/windows/windowsservercore-ltsc2016/Dockerfile index b3142dd905..3987037945 100644 --- a/3.6/windows/windowsservercore-ltsc2016/Dockerfile +++ b/3.6/windows/windowsservercore-ltsc2016/Dockerfile @@ -26,9 +26,15 @@ RUN Write-Host ('Downloading {0} ...' -f $env:MONGO_DOWNLOAD_URL); \ 'mongo.msi', \ '/quiet', \ '/qn', \ + '/l*v', 'install.log', \ +# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows-unattended/#run-the-windows-installer-from-the-windows-command-interpreter 'INSTALLLOCATION=C:\mongodb', \ - 'ADDLOCAL=all' \ + 'ADDLOCAL=Server,Client,Router,MiscellaneousTools,MonitoringTools,ImportExportTools' \ ); \ + \ +# Get-Content install.log; \ + Remove-Item install.log; \ + \ $env:PATH = 'C:\mongodb\bin;' + $env:PATH; \ [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ \ diff --git a/4.0/windows/windowsservercore-1809/Dockerfile b/4.0/windows/windowsservercore-1809/Dockerfile index 64cf086660..00a6304337 100644 --- a/4.0/windows/windowsservercore-1809/Dockerfile +++ b/4.0/windows/windowsservercore-1809/Dockerfile @@ -26,9 +26,15 @@ RUN Write-Host ('Downloading {0} ...' -f $env:MONGO_DOWNLOAD_URL); \ 'mongo.msi', \ '/quiet', \ '/qn', \ + '/l*v', 'install.log', \ +# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows-unattended/#run-the-windows-installer-from-the-windows-command-interpreter 'INSTALLLOCATION=C:\mongodb', \ - 'ADDLOCAL=all' \ + 'ADDLOCAL=ServerNoService,Client,Router,MiscellaneousTools,MonitoringTools,ImportExportTools' \ ); \ + \ +# Get-Content install.log; \ + Remove-Item install.log; \ + \ $env:PATH = 'C:\mongodb\bin;' + $env:PATH; \ [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ \ diff --git a/4.0/windows/windowsservercore-ltsc2016/Dockerfile b/4.0/windows/windowsservercore-ltsc2016/Dockerfile index ac42d7ae03..a2042df531 100644 --- a/4.0/windows/windowsservercore-ltsc2016/Dockerfile +++ b/4.0/windows/windowsservercore-ltsc2016/Dockerfile @@ -26,9 +26,15 @@ RUN Write-Host ('Downloading {0} ...' -f $env:MONGO_DOWNLOAD_URL); \ 'mongo.msi', \ '/quiet', \ '/qn', \ + '/l*v', 'install.log', \ +# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows-unattended/#run-the-windows-installer-from-the-windows-command-interpreter 'INSTALLLOCATION=C:\mongodb', \ - 'ADDLOCAL=all' \ + 'ADDLOCAL=ServerNoService,Client,Router,MiscellaneousTools,MonitoringTools,ImportExportTools' \ ); \ + \ +# Get-Content install.log; \ + Remove-Item install.log; \ + \ $env:PATH = 'C:\mongodb\bin;' + $env:PATH; \ [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ \ diff --git a/4.2/windows/windowsservercore-1809/Dockerfile b/4.2/windows/windowsservercore-1809/Dockerfile index ed59b8b745..230a4a7ac5 100644 --- a/4.2/windows/windowsservercore-1809/Dockerfile +++ b/4.2/windows/windowsservercore-1809/Dockerfile @@ -26,9 +26,15 @@ RUN Write-Host ('Downloading {0} ...' -f $env:MONGO_DOWNLOAD_URL); \ 'mongo.msi', \ '/quiet', \ '/qn', \ + '/l*v', 'install.log', \ +# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows-unattended/#run-the-windows-installer-from-the-windows-command-interpreter 'INSTALLLOCATION=C:\mongodb', \ - 'ADDLOCAL=all' \ + 'ADDLOCAL=ServerNoService,Client,Router,MiscellaneousTools,MonitoringTools,ImportExportTools' \ ); \ + \ +# Get-Content install.log; \ + Remove-Item install.log; \ + \ $env:PATH = 'C:\mongodb\bin;' + $env:PATH; \ [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ \ diff --git a/4.2/windows/windowsservercore-ltsc2016/Dockerfile b/4.2/windows/windowsservercore-ltsc2016/Dockerfile index 218b6d2e35..c235afb700 100644 --- a/4.2/windows/windowsservercore-ltsc2016/Dockerfile +++ b/4.2/windows/windowsservercore-ltsc2016/Dockerfile @@ -26,9 +26,15 @@ RUN Write-Host ('Downloading {0} ...' -f $env:MONGO_DOWNLOAD_URL); \ 'mongo.msi', \ '/quiet', \ '/qn', \ + '/l*v', 'install.log', \ +# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows-unattended/#run-the-windows-installer-from-the-windows-command-interpreter 'INSTALLLOCATION=C:\mongodb', \ - 'ADDLOCAL=all' \ + 'ADDLOCAL=ServerNoService,Client,Router,MiscellaneousTools,MonitoringTools,ImportExportTools' \ ); \ + \ +# Get-Content install.log; \ + Remove-Item install.log; \ + \ $env:PATH = 'C:\mongodb\bin;' + $env:PATH; \ [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ \ diff --git a/4.4/windows/windowsservercore-1809/Dockerfile b/4.4/windows/windowsservercore-1809/Dockerfile index aac63f5ea5..d078ea7dd8 100644 --- a/4.4/windows/windowsservercore-1809/Dockerfile +++ b/4.4/windows/windowsservercore-1809/Dockerfile @@ -26,9 +26,15 @@ RUN Write-Host ('Downloading {0} ...' -f $env:MONGO_DOWNLOAD_URL); \ 'mongo.msi', \ '/quiet', \ '/qn', \ + '/l*v', 'install.log', \ +# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows-unattended/#run-the-windows-installer-from-the-windows-command-interpreter 'INSTALLLOCATION=C:\mongodb', \ - 'ADDLOCAL=all' \ + 'ADDLOCAL=ServerNoService,Client,Router,MiscellaneousTools' \ ); \ + \ +# Get-Content install.log; \ + Remove-Item install.log; \ + \ $env:PATH = 'C:\mongodb\bin;' + $env:PATH; \ [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ \ diff --git a/4.4/windows/windowsservercore-ltsc2016/Dockerfile b/4.4/windows/windowsservercore-ltsc2016/Dockerfile index 87bc3de750..c288b41713 100644 --- a/4.4/windows/windowsservercore-ltsc2016/Dockerfile +++ b/4.4/windows/windowsservercore-ltsc2016/Dockerfile @@ -26,9 +26,15 @@ RUN Write-Host ('Downloading {0} ...' -f $env:MONGO_DOWNLOAD_URL); \ 'mongo.msi', \ '/quiet', \ '/qn', \ + '/l*v', 'install.log', \ +# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows-unattended/#run-the-windows-installer-from-the-windows-command-interpreter 'INSTALLLOCATION=C:\mongodb', \ - 'ADDLOCAL=all' \ + 'ADDLOCAL=ServerNoService,Client,Router,MiscellaneousTools' \ ); \ + \ +# Get-Content install.log; \ + Remove-Item install.log; \ + \ $env:PATH = 'C:\mongodb\bin;' + $env:PATH; \ [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ \ diff --git a/Dockerfile-windows.template b/Dockerfile-windows.template index 8644f02f9b..d10effb6be 100644 --- a/Dockerfile-windows.template +++ b/Dockerfile-windows.template @@ -26,9 +26,15 @@ RUN Write-Host ('Downloading {0} ...' -f $env:MONGO_DOWNLOAD_URL); \ 'mongo.msi', \ '/quiet', \ '/qn', \ + '/l*v', 'install.log', \ +# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows-unattended/#run-the-windows-installer-from-the-windows-command-interpreter 'INSTALLLOCATION=C:\mongodb', \ - 'ADDLOCAL=all' \ + 'ADDLOCAL=placeholder' \ ); \ + \ +# Get-Content install.log; \ + Remove-Item install.log; \ + \ $env:PATH = 'C:\mongodb\bin;' + $env:PATH; \ [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ \ diff --git a/update.sh b/update.sh index 7732eda75a..29b064d15f 100755 --- a/update.sh +++ b/update.sh @@ -180,6 +180,18 @@ for version in "${versions[@]}"; do # 4.3 doesn't seem to have a sha256 file (403 forbidden), so this has to be optional :( windowsSha256="$(curl -fsSL "$windowsMsi.sha256" | cut -d' ' -f1 || :)" + # https://github.com/mongodb/mongo/blob/r4.4.2/src/mongo/installer/msi/wxs/FeatureFragment.wxs#L9-L92 (no MonitoringTools,ImportExportTools) + # https://github.com/mongodb/mongo/blob/r4.2.11/src/mongo/installer/msi/wxs/FeatureFragment.wxs#L9-L116 + # https://github.com/mongodb/mongo/blob/r4.0.21/src/mongo/installer/msi/wxs/FeatureFragment.wxs#L9-L128 + # https://github.com/mongodb/mongo/blob/r3.6.21/src/mongo/installer/msi/wxs/FeatureFragment.wxs#L9-L102 (no ServerNoService, only Server) + windowsFeatures='ServerNoService,Client,Router,MiscellaneousTools' + case "$rcVersion" in + 4.2 | 4.0 | 3.6) windowsFeatures+=',MonitoringTools,ImportExportTools' ;; + esac + if [ "$rcVersion" = '3.6' ]; then + windowsFeatures="${windowsFeatures//ServerNoService/Server}" + fi + for winVariant in \ windowsservercore-{1809,ltsc2016} \ ; do @@ -190,6 +202,7 @@ for version in "${versions[@]}"; do -e 's!^(ENV MONGO_DOWNLOAD_URL) .*!\1 '"$windowsMsi"'!' \ -e 's/^(ENV MONGO_DOWNLOAD_SHA256)=.*/\1='"$windowsSha256"'/' \ -e 's!^(FROM .+):.+!\1:'"${winVariant#*-}"'!' \ + -e 's!(ADDLOCAL)=placeholder!\1='"$windowsFeatures"'!' \ Dockerfile-windows.template \ > "$version/windows/$winVariant/Dockerfile" done