Skip to content

Docker image size #958

Open
Open
@colinleach

Description

@colinleach

Background

The repo is here. The Dockerfile is here. In the last 3 years this has had few changes: dependabot merges and a sync of org-wide files (code of conduct, etc.)

There was a push in 2023 to reduce image sizes. At that time, Julia was a large but not crazy 765 MB. For comparison, the Python test runner was 145 MB then and is 90.6 MB now. Honestly, I never expect Julia to match that (we're like Python + NumPy + Pandas).

Building the current Dockerfile locally now gives a image of a startling 1.34 GB, which is costing Exercism money, paid regularly to AWS.

Shrinking it would be good! Obviously, it is vital to make sure any changes don't break solutions, and don't slow runtime performance.

Base images

The library image julia:1.11.5 is based on debian:bookworm-slim.

To get I feel for the various official Julia 1.11.5 images, I built a few locally, plus debian:bookworm-slim. The default julia:alpine failed repeatedly.

Image Size
current test runner 1.34 GB
julia:1.11.5 1.11 GB
julia:1.11.5-bullseye 1.11 GB
julia:alpine3.22 500 error
julia:alpine3.21 1.04 GB
debian:bookworm-slim 74.8 MB

So all the Julia images are >1 GB, nearly 15x the size of the base Debian image. Even alpine isn't much smaller (and we don't know if it will even work in the test runner).

Maybe we could slightly shrink the stuff we add in julia-test-runner, but it won't solve the size problem.

Julia installation

Downloading julia-1.11.5-linux-x86_64.tar.gz via curl, as the official julia:1.11.5 Dockerfile does, gives an installation which is 285.8 MB compressed and 988 MB uncompressed. This points to the main issue!

There has been discussion about the ever-growing installation sizes, for example here.

To quote:

It seems that during the build process stdlibs are compiled with the 2 differents configurations:
1/ -g2 -O3
2/ -g2 -O3 --check-bounds=yes

and:

there’s definitely a case for a light version…And doubling the size for testing packages with checkounds=yes, seems like something that could be served by a dev version.
But with all of these things, someone needs to care and put time into it.

Exercism has a stated preference for official images, and I don't feel competent to get deep into messing with this.

Unfortunately, it seems likely that Julia 1.12 will be even bigger when released in the next few months.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions