Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InfluxDB Docker image 2.3 has 60% size increase #624

Open
ypnos opened this issue Jul 21, 2022 · 4 comments
Open

InfluxDB Docker image 2.3 has 60% size increase #624

ypnos opened this issue Jul 21, 2022 · 4 comments
Labels

Comments

@ypnos
Copy link

ypnos commented Jul 21, 2022

There is a surprising growth for only minor changes in the shipped software:

  1. 2.2-alpine 120 MB
  2. 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?

@ypnos ypnos changed the title Docker image 2.3 has 60% size increase InfluxDB Docker image 2.3 has 60% size increase Jul 21, 2022
@J0WI
Copy link
Contributor

J0WI commented Aug 11, 2022

InfluxDB 2.3 itself is significant larger than 2.2: https://github.com/influxdata/influxdb/releases

@ypnos
Copy link
Author

ypnos commented Aug 13, 2022

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.

@ypnos
Copy link
Author

ypnos commented Aug 13, 2022

For comparison, here are bitnami's images:

  1. 2.2.0 145 MB
  2. 2.3.0 130 MB

@wborn
Copy link

wborn commented Aug 20, 2022

I think the size increase is due to the downloaded influxd files in /influxdb2_linux_${ARCH} are never removed.

This dir is created here:

tar xzf influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}.tar.gz && \
cp influxdb2_linux_${ARCH}/influxd /usr/local/bin/influxd && \

The other dirs are removed in:

RUN gpgconf --kill all && \
rm -rf \
"/root/.gnupg" \
influxdb2.key \
influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}* \
influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}*

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants