-
Notifications
You must be signed in to change notification settings - Fork 506
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
Reduce Shaka Packager official docker image size #535
Comments
Hi there, while using Alpine Linux inside a Docker container recently, I became aware of the fact that it is based on musl libc instead of glibc. As I haven't been that much into this specific details of Alpine-based containers yet, this has been new to me but perfectly made sense to me regarding their goal of size squeezing after coming from uclibc already. However, I believe completely switching to a non-glibc distribution would not be universal enough to make it easy for others to build upon Shaka Packager's official image as baseline image to do other general purpose things with it. Especially when it comes to cross-platform support, the straight Debian distribution is still the most powerful thing around, see also:
This is actually so true and I experienced it on my own workbench when trying to do cross-compilation with Rust against MIPS inside a Docker container the other day: Debian just shines with multiarch support, so I had to switch the Dockerfile from Ubuntu to Debian stretch and haven't looked back. While I have to admit running Shaka Packager on ARM or MIPS will not be its primary target, some people might want to do it nevertheless and then will be able to simply use the canonical/official Docker image for running the build process even against non-amd64 architectures. You might have got it already: I just personally prefer Debian even more over other distributions after Ubuntu occasionally made me feel bad. So, other reasons aside, I would definitively try to use plain Debian as a primary candidate to base the Docker image upon and optimize image size by other means if possible. Saying this, I didn't hear about Just my two cents. Cheers, |
@amotl Thanks for your comments, but I am not sure if I completely understand your points.
Yes, absolutely. However, to do cross compilation in the docker container for Shaka Packager, we'll need to include the source code in the image, which is what we have now. The image size is more than 1GB, which is unnecessarily big, as for most users, it is sufficient to just have the application binaries. For this use case, I think it is actually simpler for the user to pull in the code directly from GitHub. We provide docker files for various platforms in https://github.com/google/shaka-packager/tree/master/packager/testing/dockers, which users can reuse to create their own container. If it helps, we can also create Shaka Packager dev images with source code on DockerHub. For the docker image with just the application binaries, I don't see a difference in functionality with using Debian or Alpine as the base. Let me know if I missed anything. |
Ah, i see. Sure.
Ah, i see again. I haven't been aware of that armada of Docker support files for different platforms. Perfect!
Right, I was thinking about something like that, if there would be actually demand for that. Thanks for sharing your insights and sorry for the noise! |
Our docker images are more than 1 GB each.
There are a number of ways we can reduce our docker image size:
The text was updated successfully, but these errors were encountered: