Skip to content

Commit a521182

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

File tree

9 files changed

+133
-28
lines changed

9 files changed

+133
-28
lines changed
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
USER ContainerAdministrator
7+
RUN setx /m PATH "C:\mongodb\bin;%PATH%"
8+
USER ContainerUser
9+
# doing this first to share cache across versions more aggressively
10+
11+
COPY --from=mongo:3.6.23-windowsservercore-1809 \
12+
C:\\Windows\\System32\\msvcp140.dll \
13+
C:\\Windows\\System32\\vcruntime140.dll \
14+
C:\\Windows\\System32\\vcruntime140_1.dll \
15+
C:\\Windows\\System32\\
16+
17+
ENV MONGO_VERSION 3.6.23
18+
19+
COPY --from=mongo:3.6.23-windowsservercore-1809 C:\\mongodb C:\\mongodb
20+
RUN mongo --version && mongod --version
21+
22+
VOLUME C:\\data\\db C:\\data\\configdb
23+
24+
EXPOSE 27017
25+
CMD ["mongod", "--bind_ip_all"]
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
USER ContainerAdministrator
7+
RUN setx /m PATH "C:\mongodb\bin;%PATH%"
8+
USER ContainerUser
9+
# doing this first to share cache across versions more aggressively
10+
11+
COPY --from=mongo:4.0.24-windowsservercore-1809 \
12+
C:\\Windows\\System32\\msvcp140.dll \
13+
C:\\Windows\\System32\\vcruntime140.dll \
14+
C:\\Windows\\System32\\vcruntime140_1.dll \
15+
C:\\Windows\\System32\\
16+
17+
ENV MONGO_VERSION 4.0.24
18+
19+
COPY --from=mongo:4.0.24-windowsservercore-1809 C:\\mongodb C:\\mongodb
20+
RUN mongo --version && mongod --version
21+
22+
VOLUME C:\\data\\db C:\\data\\configdb
23+
24+
EXPOSE 27017
25+
CMD ["mongod", "--bind_ip_all"]
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
USER ContainerAdministrator
7+
RUN setx /m PATH "C:\mongodb\bin;%PATH%"
8+
USER ContainerUser
9+
# doing this first to share cache across versions more aggressively
10+
11+
COPY --from=mongo:4.2.14-windowsservercore-1809 \
12+
C:\\Windows\\System32\\msvcp140.dll \
13+
C:\\Windows\\System32\\vcruntime140.dll \
14+
C:\\Windows\\System32\\vcruntime140_1.dll \
15+
C:\\Windows\\System32\\
16+
17+
ENV MONGO_VERSION 4.2.14
18+
19+
COPY --from=mongo:4.2.14-windowsservercore-1809 C:\\mongodb C:\\mongodb
20+
RUN mongo --version && mongod --version
21+
22+
VOLUME C:\\data\\db C:\\data\\configdb
23+
24+
EXPOSE 27017
25+
CMD ["mongod", "--bind_ip_all"]

4.2/windows/windowsnanoserver-1809/Dockerfile

-13
This file was deleted.
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
USER ContainerAdministrator
7+
RUN setx /m PATH "C:\mongodb\bin;%PATH%"
8+
USER ContainerUser
9+
# doing this first to share cache across versions more aggressively
10+
11+
COPY --from=mongo:4.4.6-windowsservercore-1809 \
12+
C:\\Windows\\System32\\msvcp140.dll \
13+
C:\\Windows\\System32\\vcruntime140.dll \
14+
C:\\Windows\\System32\\vcruntime140_1.dll \
15+
C:\\Windows\\System32\\
16+
17+
ENV MONGO_VERSION 4.4.6
18+
19+
COPY --from=mongo:4.4.6-windowsservercore-1809 C:\\mongodb C:\\mongodb
20+
RUN mongo --version && mongod --version
21+
22+
VOLUME C:\\data\\db C:\\data\\configdb
23+
24+
EXPOSE 27017
25+
CMD ["mongod", "--bind_ip_all"]

4.4/windows/windowsnanoserver-1809/Dockerfile

-13
This file was deleted.
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
USER ContainerAdministrator
7+
RUN setx /m PATH "C:\mongodb\bin;%PATH%"
8+
USER ContainerUser
9+
# doing this first to share cache across versions more aggressively
10+
11+
COPY --from=placeholder \
12+
C:\\Windows\\System32\\msvcp140.dll \
13+
C:\\Windows\\System32\\vcruntime140.dll \
14+
C:\\Windows\\System32\\vcruntime140_1.dll \
15+
C:\\Windows\\System32\\
16+
17+
ENV MONGO_VERSION placeholder
18+
19+
COPY --from=placeholder C:\\mongodb C:\\mongodb
20+
RUN mongo --version && mongod --version
21+
22+
VOLUME C:\\data\\db C:\\data\\configdb
23+
24+
EXPOSE 27017
25+
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)