Skip to content

Commit a2cc471

Browse files
committed
Add new "Dockerfile-windows-nanoserver.template"
1 parent 518633e commit a2cc471

File tree

9 files changed

+138
-28
lines changed

9 files changed

+138
-28
lines changed
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM mcr.microsoft.com/windows/nanoserver:1809
2+
3+
SHELL ["cmd", "/S", "/C"]
4+
5+
# PATH isn't actually set in the Docker image, so we have to set it from within the container
6+
# ... and we'll set up C:\data with appropriate (unprivileged) permissions while we're at it
7+
USER ContainerAdministrator
8+
RUN setx /m PATH "C:\mongodb\bin;%PATH%" && mkdir C:\data && icacls C:\data /grant Users:F /t
9+
USER ContainerUser
10+
# doing this first to share cache across versions more aggressively
11+
12+
COPY --from=mongo:3.6.23-windowsservercore-1809 \
13+
C:\\Windows\\System32\\msvcp140.dll \
14+
C:\\Windows\\System32\\vcruntime140.dll \
15+
C:\\Windows\\System32\\vcruntime140_1.dll \
16+
C:\\Windows\\System32\\
17+
18+
ENV MONGO_VERSION 3.6.23
19+
20+
COPY --from=mongo:3.6.23-windowsservercore-1809 C:\\mongodb C:\\mongodb
21+
RUN mongo --version && mongod --version
22+
23+
VOLUME C:\\data\\db C:\\data\\configdb
24+
25+
EXPOSE 27017
26+
CMD ["mongod", "--bind_ip_all"]
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM mcr.microsoft.com/windows/nanoserver:1809
2+
3+
SHELL ["cmd", "/S", "/C"]
4+
5+
# PATH isn't actually set in the Docker image, so we have to set it from within the container
6+
# ... and we'll set up C:\data with appropriate (unprivileged) permissions while we're at it
7+
USER ContainerAdministrator
8+
RUN setx /m PATH "C:\mongodb\bin;%PATH%" && mkdir C:\data && icacls C:\data /grant Users:F /t
9+
USER ContainerUser
10+
# doing this first to share cache across versions more aggressively
11+
12+
COPY --from=mongo:4.0.24-windowsservercore-1809 \
13+
C:\\Windows\\System32\\msvcp140.dll \
14+
C:\\Windows\\System32\\vcruntime140.dll \
15+
C:\\Windows\\System32\\vcruntime140_1.dll \
16+
C:\\Windows\\System32\\
17+
18+
ENV MONGO_VERSION 4.0.24
19+
20+
COPY --from=mongo:4.0.24-windowsservercore-1809 C:\\mongodb C:\\mongodb
21+
RUN mongo --version && mongod --version
22+
23+
VOLUME C:\\data\\db C:\\data\\configdb
24+
25+
EXPOSE 27017
26+
CMD ["mongod", "--bind_ip_all"]
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM mcr.microsoft.com/windows/nanoserver:1809
2+
3+
SHELL ["cmd", "/S", "/C"]
4+
5+
# PATH isn't actually set in the Docker image, so we have to set it from within the container
6+
# ... and we'll set up C:\data with appropriate (unprivileged) permissions while we're at it
7+
USER ContainerAdministrator
8+
RUN setx /m PATH "C:\mongodb\bin;%PATH%" && mkdir C:\data && icacls C:\data /grant Users:F /t
9+
USER ContainerUser
10+
# doing this first to share cache across versions more aggressively
11+
12+
COPY --from=mongo:4.2.14-windowsservercore-1809 \
13+
C:\\Windows\\System32\\msvcp140.dll \
14+
C:\\Windows\\System32\\vcruntime140.dll \
15+
C:\\Windows\\System32\\vcruntime140_1.dll \
16+
C:\\Windows\\System32\\
17+
18+
ENV MONGO_VERSION 4.2.14
19+
20+
COPY --from=mongo:4.2.14-windowsservercore-1809 C:\\mongodb C:\\mongodb
21+
RUN mongo --version && mongod --version
22+
23+
VOLUME C:\\data\\db C:\\data\\configdb
24+
25+
EXPOSE 27017
26+
CMD ["mongod", "--bind_ip_all"]

4.2/windows/windowsnanoserver-1809/Dockerfile

-13
This file was deleted.
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM mcr.microsoft.com/windows/nanoserver:1809
2+
3+
SHELL ["cmd", "/S", "/C"]
4+
5+
# PATH isn't actually set in the Docker image, so we have to set it from within the container
6+
# ... and we'll set up C:\data with appropriate (unprivileged) permissions while we're at it
7+
USER ContainerAdministrator
8+
RUN setx /m PATH "C:\mongodb\bin;%PATH%" && mkdir C:\data && icacls C:\data /grant Users:F /t
9+
USER ContainerUser
10+
# doing this first to share cache across versions more aggressively
11+
12+
COPY --from=mongo:4.4.6-windowsservercore-1809 \
13+
C:\\Windows\\System32\\msvcp140.dll \
14+
C:\\Windows\\System32\\vcruntime140.dll \
15+
C:\\Windows\\System32\\vcruntime140_1.dll \
16+
C:\\Windows\\System32\\
17+
18+
ENV MONGO_VERSION 4.4.6
19+
20+
COPY --from=mongo:4.4.6-windowsservercore-1809 C:\\mongodb C:\\mongodb
21+
RUN mongo --version && mongod --version
22+
23+
VOLUME C:\\data\\db C:\\data\\configdb
24+
25+
EXPOSE 27017
26+
CMD ["mongod", "--bind_ip_all"]

4.4/windows/windowsnanoserver-1809/Dockerfile

-13
This file was deleted.
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM mcr.microsoft.com/windows/nanoserver:placeholder
2+
3+
SHELL ["cmd", "/S", "/C"]
4+
5+
# PATH isn't actually set in the Docker image, so we have to set it from within the container
6+
# ... and we'll set up C:\data with appropriate (unprivileged) permissions while we're at it
7+
USER ContainerAdministrator
8+
RUN setx /m PATH "C:\mongodb\bin;%PATH%" && mkdir C:\data && icacls C:\data /grant Users:F /t
9+
USER ContainerUser
10+
# doing this first to share cache across versions more aggressively
11+
12+
COPY --from=placeholder \
13+
C:\\Windows\\System32\\msvcp140.dll \
14+
C:\\Windows\\System32\\vcruntime140.dll \
15+
C:\\Windows\\System32\\vcruntime140_1.dll \
16+
C:\\Windows\\System32\\
17+
18+
ENV MONGO_VERSION placeholder
19+
20+
COPY --from=placeholder C:\\mongodb C:\\mongodb
21+
RUN mongo --version && mongod --version
22+
23+
VOLUME C:\\data\\db C:\\data\\configdb
24+
25+
EXPOSE 27017
26+
CMD ["mongod", "--bind_ip_all"]

generate-stackbrew-library.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ for version in "${versions[@]}"; do
101101

102102
for v in \
103103
windows/windowsservercore-{1809,ltsc2016} \
104-
windows/nanoserver-{1809,sac2016} \
104+
windows/nanoserver-1809 \
105105
; do
106106
dir="$version/$v"
107107
variant="$(basename "$v")"

update.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,22 @@ for version in "${versions[@]}"; do
187187

188188
for winVariant in \
189189
windowsservercore-{1809,ltsc2016} \
190+
nanoserver-1809 \
190191
; do
191192
mkdir -p "$version/windows/$winVariant"
192193

194+
template='Dockerfile-windows.template'
195+
if [[ "$winVariant" == nanoserver-* ]]; then
196+
template='Dockerfile-windows-nanoserver.template'
197+
fi
193198
sed -r \
194199
-e 's/^(ENV MONGO_VERSION) .*/\1 '"$fullVersion"'/' \
195200
-e 's!^(ENV MONGO_DOWNLOAD_URL) .*!\1 '"$windowsMsi"'!' \
196201
-e 's/^(ENV MONGO_DOWNLOAD_SHA256)=.*/\1='"$windowsSha256"'/' \
197202
-e 's!^(FROM .+):.+!\1:'"${winVariant#*-}"'!' \
203+
-e 's!^(COPY --from)=[^[:space:]]+!\1=mongo:'"$fullVersion"'-windowsservercore-'"${winVariant#*-}"'!' \
198204
-e 's!(ADDLOCAL)=placeholder!\1='"$windowsFeatures"'!' \
199-
Dockerfile-windows.template \
205+
"$template" \
200206
> "$version/windows/$winVariant/Dockerfile"
201207
done
202208
done

0 commit comments

Comments
 (0)