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

Clustertools image size could be optimized #24

Open
kosstennbl opened this issue Apr 15, 2024 · 2 comments
Open

Clustertools image size could be optimized #24

kosstennbl opened this issue Apr 15, 2024 · 2 comments

Comments

@kosstennbl
Copy link
Contributor

Clustertools image size is ~ 2.1GB, which has to be downloaded and extracted.
Possibly it can be made smaller for faster usage and less space consumption.

Improvement possibilities:
Join layers for Wireshark installation, for external tools download.
Use --no-install-recommends with apt when installing packages.
Remove all the packages needed for build after building Wireshark.
Remove tar archives for external tools.
Remove source code of Wireshark and OpenMetricsValidator after build.

@martin-mat
Copy link
Collaborator

martin-mat commented Apr 15, 2024

image
image

cloning/checking out of wireshark can be optimized. The key is in those 2 layers:

RUN git clone https://github.com/wireshark/wireshark.git /wireshark
RUN cd /wireshark && \
    git checkout tags/wireshark-4.0.8 && \
    mkdir build && \
    cd build && \
    cmake ../ && \
    make -j`nproc` && \
    make install

to something like this:

RUN git clone https://github.com/wireshark/wireshark.git --branch wireshark-4.0.8 --depth 1 --single-branch /wireshark &&
    cd /wireshark && \
    mkdir build && \
    cd build && \
    cmake ../ && \
    make -j`nproc` && \
    make install && \
    cd / &&
    rm -rf /wireshark

That would save probably about 2.5G from the image size.

@horecoli
Copy link
Contributor

I believe that a multi-stage build can be used for building Wireshark, where only the binary is copied to a new Debian image. This can be done similarly to how it is done with the validator.

martin-mat added a commit to martin-mat/cnf-testsuite that referenced this issue Aug 19, 2024
Optimizing cluster-tools for download amount/speed.
Refs: cnf-testsuite/cluster_tools#24

Signed-off-by: Martin Matyas <[email protected]>
martin-mat added a commit to cnti-testcatalog/testsuite that referenced this issue Aug 20, 2024
Optimizing cluster-tools for download amount/speed.
Refs: cnf-testsuite/cluster_tools#24

Signed-off-by: Martin Matyas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants