InfluxDB Docker image 2.3 has 60% size increase
ypnos opened this issue · 4 comments
There is a surprising growth for only minor changes in the shipped software:
- 2.2-alpine 120 MB
- 2.3-alpine 190 MB
Is there a legitimate cause for it or maybe an oversight and a considerably smaller 2.3 image could be produced?
InfluxDB 2.3 itself is significant larger than 2.2: https://github.com/influxdata/influxdb/releases
Thanks for your observation, however I don't quite understand it.
The file sizes of the amd64 tarballs on the release page are ~103 MB and ~85 MB for v2.2 and v2.3, respectively.
Uncompressed, it is ~165 MB and ~132 MB for v2.2 and v2.3, respectively.
So 2.3 actually looks smaller than 2.2 to me.
I think the size increase is due to the downloaded influxd files in /influxdb2_linux_${ARCH}
are never removed.
This dir is created here:
influxdata-docker/influxdb/2.3/Dockerfile
Lines 38 to 39 in d0e9594
The other dirs are removed in:
influxdata-docker/influxdb/2.3/Dockerfile
Lines 59 to 64 in d0e9594
It'll probably also help to remove the files in the same RUN
instruction used for downloading/unpacking to reduce the layer sizes. Each instruction will result in its own layer so the files will still be part of the layers if they are removed in another layer, see:
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/