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

Minifying an "ffmpeg" container - (from Discord) #42

Open
kcq opened this issue Jul 12, 2024 · 3 comments
Open

Minifying an "ffmpeg" container - (from Discord) #42

kcq opened this issue Jul 12, 2024 · 3 comments

Comments

@kcq
Copy link
Contributor

kcq commented Jul 12, 2024

User Report in Discord (Kevin)

Attempting to build a ffmpeg container. Original is 672M, when I attempt to slim it without adding in the necessary includes, the container shrinks down to ~125M, however, it doesnt contain the necessary includes so it does not work. I have come up with the following: slim build --include-path /usr/local/bin --include-path /usr/local/etc --include-path /usr/local/lib --include-path /usr/local/share/vulkan --include-path /usr/share/fonts --include-path /usr/share/libdrm --include-path /etc/OpenCL/vendors --include-bin /usr/bin/stat --include-bin /usr/sbin/groupadd --include-bin /usr/sbin/groupmod --include-bin /usr/sbin/usermod --include-bin /usr/bin/find --include-bin /usr/bin/grep --include-bin /usr/bin/id --include-bin /usr/bin/cut --include-bin /usr/bin/getent --include-bin /usr/bin/echo --include-bin /usr/bin/chmod --continue-after 1 --http-probe-off --tag kp/ffmpeg:slim --target kp/ffmpeg:latest which includes everything needed for it to work, and it does indeed work.

However, the container grows to 997M instead of shrinking.

What am I doing wrong?
the include paths and files total around the difference between the 2 containers...

@kcq kcq changed the title Minifying an "ffmpeg" container - (source: Discord) Minifying an "ffmpeg" container - (from Discord) Jul 12, 2024
@kp-emagine
Copy link

Appreciate the reply :)

# the primary command
CMD [ "--help" ]

# our entrypoint
ENTRYPOINT [ "/myffmpeg" ]

I figured I'd need to include those binaries as they are in use with the /myffmpeg script. Here is the public container: https://hub.docker.com/r/kevinpirnie/ffmpeg

and just in case, I attached a zip of the "project" as well :)

ffmpeg.zip

@kp-emagine
Copy link

Tried slimming, by using this command: slim build --include-new false --include-path /usr/local/bin --include-path /usr/local/etc --include-path /usr/local/lib --include-path /usr/local/share/vulkan --include-path /usr/share/fonts --include-path /usr/share/libdrm --include-path /etc/OpenCL/vendors --include-bin /usr/bin/stat --include-bin /usr/sbin/groupadd --include-bin /usr/sbin/groupmod --include-bin /usr/sbin/usermod --include-bin /usr/bin/find --include-bin /usr/bin/grep --include-bin /usr/bin/id --include-bin /usr/bin/cut --include-bin /usr/bin/getent --include-bin /usr/bin/echo --include-bin /usr/bin/chmod --continue-after 1 --http-probe-off --tag kp/ffmpeg:slim --target kp/ffmpeg:latest, and same. "Slim'd" container ends up being ~900M

I am going to try using the Dockerfile instead of the --target and see what happens.

@kp-emagine
Copy link

Tried it by letting slim build the images based on the Dockerfile with:

slim build --include-new=false --include-path /usr/local/bin --include-path /usr/local/etc --include-path /usr/local/lib --include-path /usr/local/share/vulkan --include-path /usr/share/fonts --include-path /usr/share/libdrm --include-path /etc/OpenCL/vendors --include-bin /usr/bin/stat --include-bin /usr/sbin/groupadd --include-bin /usr/sbin/groupmod --include-bin /usr/sbin/usermod --include-bin /usr/bin/find --include-bin /usr/bin/grep --include-bin /usr/bin/id --include-bin /usr/bin/cut --include-bin /usr/bin/getent --include-bin /usr/bin/echo --include-bin /usr/bin/chmod --continue-after 1 --http-probe-off --tag kp/ffmpeg:slim --dockerfile Dockerfile .

Results are:
Screenshot_1

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

2 participants