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

Adjust "ADDLOCAL" to disable the Windows service #438

Merged
merged 1 commit into from
Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion 3.6/windows/windowsservercore-1809/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,18 @@ 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' \
); \
if (-Not (Test-Path C:\mongodb\bin\mongo.exe -PathType Leaf)) { \
Write-Host 'Installer failed!'; \
Get-Content install.log; \
exit 1; \
}; \
Remove-Item install.log; \
\
$env:PATH = 'C:\mongodb\bin;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
\
Expand Down
11 changes: 10 additions & 1 deletion 3.6/windows/windowsservercore-ltsc2016/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,18 @@ 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' \
); \
if (-Not (Test-Path C:\mongodb\bin\mongo.exe -PathType Leaf)) { \
Write-Host 'Installer failed!'; \
Get-Content install.log; \
exit 1; \
}; \
Remove-Item install.log; \
\
$env:PATH = 'C:\mongodb\bin;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
\
Expand Down
11 changes: 10 additions & 1 deletion 4.0/windows/windowsservercore-1809/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,18 @@ 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' \
); \
if (-Not (Test-Path C:\mongodb\bin\mongo.exe -PathType Leaf)) { \
Write-Host 'Installer failed!'; \
Get-Content install.log; \
exit 1; \
}; \
Remove-Item install.log; \
\
$env:PATH = 'C:\mongodb\bin;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
\
Expand Down
11 changes: 10 additions & 1 deletion 4.0/windows/windowsservercore-ltsc2016/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,18 @@ 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' \
); \
if (-Not (Test-Path C:\mongodb\bin\mongo.exe -PathType Leaf)) { \
Write-Host 'Installer failed!'; \
Get-Content install.log; \
exit 1; \
}; \
Remove-Item install.log; \
\
$env:PATH = 'C:\mongodb\bin;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
\
Expand Down
11 changes: 10 additions & 1 deletion 4.2/windows/windowsservercore-1809/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,18 @@ 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' \
); \
if (-Not (Test-Path C:\mongodb\bin\mongo.exe -PathType Leaf)) { \
Write-Host 'Installer failed!'; \
Get-Content install.log; \
exit 1; \
}; \
Remove-Item install.log; \
\
$env:PATH = 'C:\mongodb\bin;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
\
Expand Down
11 changes: 10 additions & 1 deletion 4.2/windows/windowsservercore-ltsc2016/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,18 @@ 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' \
); \
if (-Not (Test-Path C:\mongodb\bin\mongo.exe -PathType Leaf)) { \
Write-Host 'Installer failed!'; \
Get-Content install.log; \
exit 1; \
}; \
Remove-Item install.log; \
\
$env:PATH = 'C:\mongodb\bin;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
\
Expand Down
11 changes: 10 additions & 1 deletion 4.4/windows/windowsservercore-1809/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,18 @@ 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' \
); \
if (-Not (Test-Path C:\mongodb\bin\mongo.exe -PathType Leaf)) { \
Write-Host 'Installer failed!'; \
Get-Content install.log; \
exit 1; \
}; \
Remove-Item install.log; \
\
$env:PATH = 'C:\mongodb\bin;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
\
Expand Down
11 changes: 10 additions & 1 deletion 4.4/windows/windowsservercore-ltsc2016/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,18 @@ 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' \
Copy link
Member Author

Choose a reason for hiding this comment

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

As a TODO for later, we should probably consider installing the "tools" / "shell" in 4.4+ (now that they're all separate), like we do in the Linux images.

); \
if (-Not (Test-Path C:\mongodb\bin\mongo.exe -PathType Leaf)) { \
Write-Host 'Installer failed!'; \
Get-Content install.log; \
exit 1; \
}; \
Remove-Item install.log; \
\
$env:PATH = 'C:\mongodb\bin;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
\
Expand Down
11 changes: 10 additions & 1 deletion Dockerfile-windows.template
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,18 @@ 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' \
); \
if (-Not (Test-Path C:\mongodb\bin\mongo.exe -PathType Leaf)) { \
Write-Host 'Installer failed!'; \
Get-Content install.log; \
exit 1; \
}; \
Remove-Item install.log; \
\
$env:PATH = 'C:\mongodb\bin;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
\
Expand Down
13 changes: 13 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down