Skip to content

Commit e320c58

Browse files
committed
Integrate nanoserver in templating
1 parent 9e4b364 commit e320c58

File tree

17 files changed

+188
-49
lines changed

17 files changed

+188
-49
lines changed

4.0/windows/nanoserver-1809/Dockerfile

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

4.0/windows/windowsservercore-1809/Dockerfile

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

4.0/windows/windowsservercore-ltsc2016/Dockerfile

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

4.2/windows/nanoserver-1809/Dockerfile

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

4.2/windows/windowsnanoserver-1809/Dockerfile

-13
This file was deleted.

4.2/windows/windowsservercore-1809/Dockerfile

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

4.2/windows/windowsservercore-ltsc2016/Dockerfile

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

4.4/windows/nanoserver-1809/Dockerfile

+33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

4.4/windows/windowsnanoserver-1809/Dockerfile

-13
This file was deleted.

4.4/windows/windowsservercore-1809/Dockerfile

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

4.4/windows/windowsservercore-ltsc2016/Dockerfile

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

4.9-rc/windows/nanoserver-1809/Dockerfile

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

4.9-rc/windows/windowsservercore-1809/Dockerfile

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

4.9-rc/windows/windowsservercore-ltsc2016/Dockerfile

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile-windows.template

+33-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM mcr.microsoft.com/windows/{{ env.windowsVariant }}:{{ env.windowsRelease }}
22

3+
{{ if env.windowsVariant == "servercore" then ( -}}
34
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
45

56
{{ if .notes then ( -}}
@@ -58,9 +59,39 @@ RUN Write-Host ('Downloading {0} ...' -f $env:MONGO_DOWNLOAD_URL); \
5859
\
5960
Write-Host 'Complete.';
6061

61-
VOLUME C:\\data\\db C:\\data\\configdb
62-
6362
# TODO docker-entrypoint.ps1 ? (for "docker run <image> --flag --flag --flag")
63+
{{ ) else ( -}}
64+
SHELL ["cmd", "/S", "/C"]
65+
66+
# PATH isn't actually set in the Docker image, so we have to set it from within the container
67+
USER ContainerAdministrator
68+
RUN setx /m PATH "C:\mongodb\bin;%PATH%"
69+
USER ContainerUser
70+
# doing this first to share cache across versions more aggressively
71+
72+
{{ def copy_from: "mongo:" + .version + "-windowsservercore-" + env.windowsRelease -}}
73+
COPY --from={{ copy_from }} \
74+
C:\\Windows\\System32\\msvcp140.dll \
75+
C:\\Windows\\System32\\vcruntime140.dll \
76+
{{ if [ "4.0", "4.2" ] | index(env.version) then "" else ( -}}
77+
{{ # https://github.com/docker-library/mongo/pull/470#discussion_r633701963 -}}
78+
C:\\Windows\\System32\\vcruntime140_1.dll \
79+
{{ ) end -}}
80+
C:\\Windows\\System32\\
81+
82+
{{ if .notes then ( -}}
83+
# {{ .notes }}
84+
{{ ) else "" end -}}
85+
ENV MONGO_VERSION {{ .version }}
86+
{{ if .date or .githash then ( -}}
87+
# {{ [ .date // empty, "https://github.com/mongodb/mongo/tree/" + .githash // empty ] | join(", ") }}
88+
{{ ) else "" end -}}
89+
90+
COPY --from={{ copy_from }} C:\\mongodb C:\\mongodb
91+
RUN mongo --version && mongod --version
92+
{{ ) end -}}
93+
94+
VOLUME C:\\data\\db C:\\data\\configdb
6495

6596
EXPOSE 27017
6697
CMD ["mongod", "--bind_ip_all"]

versions.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"sha256": "e17a25bc51b6bdcf6da0fe6b0ba22075b43566119c656b454542735133cd9f1e",
4141
"variants": [
4242
"windowsservercore-1809",
43-
"windowsservercore-ltsc2016"
43+
"windowsservercore-ltsc2016",
44+
"nanoserver-1809"
4445
]
4546
}
4647
},
@@ -94,7 +95,8 @@
9495
"sha256": "706610f96ae74963d5348aafe34f976e7b1c02ef1a9f3596862e1e5ba3437e76",
9596
"variants": [
9697
"windowsservercore-1809",
97-
"windowsservercore-ltsc2016"
98+
"windowsservercore-ltsc2016",
99+
"nanoserver-1809"
98100
]
99101
}
100102
},
@@ -155,7 +157,8 @@
155157
"sha256": "ede50e8f8d8c9d23a8ca2cc1c96cdb9bcc1f617930e8bd1d46f21d95d0b555f8",
156158
"variants": [
157159
"windowsservercore-1809",
158-
"windowsservercore-ltsc2016"
160+
"windowsservercore-ltsc2016",
161+
"nanoserver-1809"
159162
]
160163
}
161164
},
@@ -210,7 +213,8 @@
210213
"sha256": "67c8bf03590c7ecbaf793db559f7f7fea44eb0481a2c4e486756ee4ea9ed575c",
211214
"variants": [
212215
"windowsservercore-1809",
213-
"windowsservercore-ltsc2016"
216+
"windowsservercore-ltsc2016",
217+
"nanoserver-1809"
214218
]
215219
}
216220
},

versions.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ for version in "${versions[@]}"; do
158158
sha256: env.msiSha256,
159159
variants: [
160160
"windowsservercore-1809",
161-
"windowsservercore-ltsc2016"
161+
"windowsservercore-ltsc2016",
162+
"nanoserver-1809"
162163
],
163164
features: ([
164165
# https://github.com/mongodb/mongo/blob/r4.4.2/src/mongo/installer/msi/wxs/FeatureFragment.wxs#L9-L92 (no MonitoringTools,ImportExportTools)

0 commit comments

Comments
 (0)