# Size of installed packages in Docker images

**URL:** https://discourse.julialang.org/t/size-of-installed-packages-in-docker-images/123216
**Category:** Package Management
**Created:** [November 28, 2024, 2:29pm UTC](https://discourse.julialang.org/t/size-of-installed-packages-in-docker-images/123216 "2024-11-28T14:29:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Psirus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/psirus/32/213796_2.png) [@Psirus](https://discourse.julialang.org/u/Psirus)
#### Post date: [November 28, 2024, 2:29pm UTC](https://discourse.julialang.org/t/size-of-installed-packages-in-docker-images/123216/1 "2024-11-28T14:29:53Z")

</div>

I’m trying to build a Julia image for a CI server that has a few packages preinstalled.  
Unfortunately, my naive approach seems to install more than I need.

The layers of the base `julia:1.11` image look like this

```julia
Cmp Size Command                                                  
     97 MB FROM blobs                              
     15 MB RUN /bin/sh -c set -eux; apt-get update; apt-get install -y --no-install-recommends ca-certificates curl ...
    869 MB RUN /bin/sh -c set -eux; savedAptMark="$(apt-mark showmanual)"; apt-get update; apt-get install -y --no-install-r...
     309 B COPY docker-entrypoint.sh /usr/local/bin/ # buildkit

```

So roughly 115MB for Debian+Curl, and 900MB for Julia.

Now I start adding packages, based on a `Dockerfile` like this

```julia
FROM julia:1.11
RUN julia -e 'import Pkg; Pkg.add(["CairoMakie"])'

```

and the result is an image that looks like this

```julia
Cmp Size Command                   
     97 MB FROM blobs                                                    
     15 MB RUN /bin/sh -c set -eux; apt-get update; apt-get install -y --no-install-recommends ca-certificates curl ...
    869 MB RUN /bin/sh -c set -eux; savedAptMark="$(apt-mark showmanual)"; apt-get update; apt-get install -y --no-install-r...
     309 B COPY docker-entrypoint.sh /usr/local/bin/ # buildkit
    1.4 GB RUN /bin/sh -c julia -e 'import Pkg; Pkg.add(["CairoMakie"])' # buildkit  

```

1.4GB for Makie. An equivalent file for DifferentialEquations gives

```julia
Cmp Size Command                                         
     ...
    877 MB RUN /bin/sh -c julia -e 'import Pkg; Pkg.add(["DifferentialEquations"])' # buildkit   

```

900MB for DifferentialEquations. Combining both in one install command still adds 2.2GB. This all seems excessive. Is there a way to slim these down/remove things I might not need?

Thanks for your help

---

<div class="post-metadata">

### Author: ![MisterBiggs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/misterbiggs/32/30722_2.png) [@MisterBiggs](https://discourse.julialang.org/u/MisterBiggs)
#### Post date: [May 13, 2025, 3:53am UTC](https://discourse.julialang.org/t/size-of-installed-packages-in-docker-images/123216/2 "2025-05-13T03:53:39Z")

</div>

Any luck on reducing the size?
