Skip to content

Slim images are larger than the full images #38

Backlog

Description

@Ekhorn

The -slim tags are no longer smaller than the full images. Up to 17.9.0.1 they were about 58% smaller, in line with the ~60% in the README:

Tag amd64 arm64
17.9.0.1 2053 MB 2111 MB
17.9.0.1-slim 856 MB 833 MB
17.11.1.0, latest, develop 1499 MB 1442 MB
17.11.1.0-slim, latest-slim, develop-slim 1525 MB 1456 MB

These are the compressed sizes on Docker Hub. Core's profile/deploy.yml defaults to develop-slim (also see https://github.com/search?q=org%3Aopenremote+path%3A.env+-slim&type=code), so CI, custom projects and deployments all pull it. A slim image is a single layer, so every build means a full 1.5 GB download that can't be split into parallel layer pulls. In CI that pull takes 25 s to 1.5 min.

Cause

Uncompressed, the amd64 slim layer grew from 2.7 GB (17.9.0.1) to 4.9 GB (develop). Two things add most of the size:

  1. Unstripped TimescaleDB Toolkit libraries. timescaledb_toolkit-1.23.0.so to 1.26.0.so are 174 to 181 MB each, against 15 MB for 1.19.0 to 1.22.0. They are in both lib/postgresql/17 and lib/postgresql/15, so 8 files and 1.4 GB in total. Debug sections are 163 MB of each file: strip --strip-unneeded takes 1.26.0 from 181 MB to 15.5 MB, or from 35 MB to 5 MB gzipped.
    The Dockerfile strips libraries in the first stage and in the final stage, but neither step changes anything. The timescaledb-ha image has no strip binary, and 2>/dev/null || true hides the error. The PG 15 libraries copied from the first stage are unstripped too, and the final RUN layer of develop has no files under /usr/lib/postgresql.
  2. Fastest gzip level. Since Recompress slim layers to gzip before pushing #33 the slim layer is recompressed with regctl image mod --layer-compress gzip. That writes gzip's fastest level: the XFL byte in the gzip header is 4, where 17.9.0.1-slim has 0. Recompressing the develop-slim layer with gzip -6 gives 1312 MB instead of 1525 MB.

Fixing both would bring develop-slim to about 1.07 GB, or 3.6 GB uncompressed. The rest of the growth since 17.9.0.1 is the TimescaleDB versions kept for upgrades: 90 libraries instead of 64, and 2305 upgrade scripts instead of 1460.

Suggested fix

  • Strip with a strip that exists, for example by installing binutils in a build stage. Drop 2>/dev/null || true so that a missing tool fails the build. Stripping in the final stage only shrinks the slim image, because the full image keeps the unstripped files in the upstream layer.
  • Recompress the slim layer at gzip's default level or higher.
  • Fail the workflow when the slim image isn't smaller than the full image.

Activity

  1. added
    Enhancement
    on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions