forked from docker-library/official-images
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request docker-library#376 from infosiftr/1809
Add Windows Server Core 1809
- Loading branch information
Showing
4 changed files
with
102 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM microsoft/windowsservercore:1809 | ||
|
||
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] | ||
|
||
ENV MONGO_VERSION 4.0.13 | ||
ENV MONGO_DOWNLOAD_URL https://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-4.0.13-signed.msi | ||
ENV MONGO_DOWNLOAD_SHA256 3d81d6214017e66343be94109aa36147a684be43b2731c37e52dd14518501ec0 | ||
|
||
RUN Write-Host ('Downloading {0} ...' -f $env:MONGO_DOWNLOAD_URL); \ | ||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ | ||
(New-Object System.Net.WebClient).DownloadFile($env:MONGO_DOWNLOAD_URL, 'mongo.msi'); \ | ||
\ | ||
Write-Host ('Verifying sha256 ({0}) ...' -f $env:MONGO_DOWNLOAD_SHA256); \ | ||
if ((Get-FileHash mongo.msi -Algorithm sha256).Hash -ne $env:MONGO_DOWNLOAD_SHA256) { \ | ||
Write-Host 'FAILED!'; \ | ||
exit 1; \ | ||
}; \ | ||
\ | ||
Write-Host 'Installing ...'; \ | ||
# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/#install-mongodb-community-edition | ||
Start-Process msiexec -Wait \ | ||
-ArgumentList @( \ | ||
'/i', \ | ||
'mongo.msi', \ | ||
'/quiet', \ | ||
'/qn', \ | ||
'INSTALLLOCATION=C:\mongodb', \ | ||
'ADDLOCAL=all' \ | ||
); \ | ||
$env:PATH = 'C:\mongodb\bin;' + $env:PATH; \ | ||
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ | ||
\ | ||
Write-Host 'Verifying install ...'; \ | ||
Write-Host ' mongo --version'; mongo --version; \ | ||
Write-Host ' mongod --version'; mongod --version; \ | ||
\ | ||
Write-Host 'Removing ...'; \ | ||
Remove-Item C:\mongodb\bin\*.pdb -Force; \ | ||
Remove-Item C:\windows\installer\*.msi -Force; \ | ||
Remove-Item mongo.msi -Force; \ | ||
\ | ||
Write-Host 'Complete.'; | ||
|
||
VOLUME C:\\data\\db C:\\data\\configdb | ||
|
||
# TODO docker-entrypoint.ps1 ? (for "docker run <image> --flag --flag --flag") | ||
|
||
EXPOSE 27017 | ||
CMD ["mongod", "--bind_ip_all"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM microsoft/windowsservercore:1809 | ||
|
||
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] | ||
|
||
ENV MONGO_VERSION 4.2.1 | ||
ENV MONGO_DOWNLOAD_URL https://downloads.mongodb.org/win32/mongodb-win32-x86_64-2012plus-4.2.1-signed.msi | ||
ENV MONGO_DOWNLOAD_SHA256 0bd9f5361d21cf358156e8e18aae3f4bc0298e9949b4b988c4b15b52913f91d6 | ||
|
||
RUN Write-Host ('Downloading {0} ...' -f $env:MONGO_DOWNLOAD_URL); \ | ||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ | ||
(New-Object System.Net.WebClient).DownloadFile($env:MONGO_DOWNLOAD_URL, 'mongo.msi'); \ | ||
\ | ||
Write-Host ('Verifying sha256 ({0}) ...' -f $env:MONGO_DOWNLOAD_SHA256); \ | ||
if ((Get-FileHash mongo.msi -Algorithm sha256).Hash -ne $env:MONGO_DOWNLOAD_SHA256) { \ | ||
Write-Host 'FAILED!'; \ | ||
exit 1; \ | ||
}; \ | ||
\ | ||
Write-Host 'Installing ...'; \ | ||
# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/#install-mongodb-community-edition | ||
Start-Process msiexec -Wait \ | ||
-ArgumentList @( \ | ||
'/i', \ | ||
'mongo.msi', \ | ||
'/quiet', \ | ||
'/qn', \ | ||
'INSTALLLOCATION=C:\mongodb', \ | ||
'ADDLOCAL=all' \ | ||
); \ | ||
$env:PATH = 'C:\mongodb\bin;' + $env:PATH; \ | ||
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ | ||
\ | ||
Write-Host 'Verifying install ...'; \ | ||
Write-Host ' mongo --version'; mongo --version; \ | ||
Write-Host ' mongod --version'; mongod --version; \ | ||
\ | ||
Write-Host 'Removing ...'; \ | ||
Remove-Item C:\mongodb\bin\*.pdb -Force; \ | ||
Remove-Item C:\windows\installer\*.msi -Force; \ | ||
Remove-Item mongo.msi -Force; \ | ||
\ | ||
Write-Host 'Complete.'; | ||
|
||
VOLUME C:\\data\\db C:\\data\\configdb | ||
|
||
# TODO docker-entrypoint.ps1 ? (for "docker run <image> --flag --flag --flag") | ||
|
||
EXPOSE 27017 | ||
CMD ["mongod", "--bind_ip_all"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters