You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Optimizing the size of the MongoDB Windows Container
1
+
# MongoDB
2
2
[](https://hub.docker.com/r/stefanscherer/mongo-windows/)
3
3
4
-
## With MSI
4
+
MongoDB in a Windows NanoServer Docker image
5
5
6
-
The [3.2/msi/Dockerfile](3.2/msi/Dockerfile) downloads the MSI file of MongoDB and installs it with msiexec.
7
-
The reason for this is that the MSI file also contains `*.pdb` files, but also
8
-
the MSI file itself will be cached and Windows also writes internal binary files.
6
+
There also is a `Dockerfile` for the MongoDB Enterprise editition. You have to build it locally.
9
7
10
-
This results in a big Docker image of about **805 MByte**.
11
-
12
-
## With ZIP
13
-
14
-
The next step is to download the ZIP file instead of the MSI and extract it and remove the Zip file in a single `RUN` command. The [3.2/Dockerfile.build](3.2/Dockerfile.build) does this.
15
-
The additional optimization is to remove the `*.pdb` debug files from the container as well.
16
-
17
-
The size of this Container is **249 MByte**.
18
-
19
-
## With COPY
20
-
21
-
Using two steps to build the final Docker image can reduce the size.
22
-
Copying the extracted files from the ZIP container with a mounted volume and then
23
-
using the [3.2/Dockerfile](3.2/Dockerfile) copying the directory back into a new Docker image results in an even smaller image.
0 commit comments