-
Notifications
You must be signed in to change notification settings - Fork 14
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
Migrate to Alpine Linux for smaller images #41
Comments
* It is feature-parity with previous Ubuntu-based kernel, but its size is reduced from 1.4 GB to 610 MB. * To utilizie docker's build caches during development & testing, I used the new `docker build --squash` option so that my local docker daemon preserves intermediate layers for caching but squashes all layers into a single layer after successful builds. The original image is about 800 MB and the squashed one is 610 MB. This difference happens because the original image has intermediate layers which contains deleted files in later layers.
* Compiling NodeJS from scratch takes long time (due to icu and v8)... Maybe improved using rocker?
* JDK 8, Python 3.6-dev packages are readily available, but Google's Bazel seems not working on Alpine yet. ref) bazelbuild/bazel#1492 Let's come back after some time here.
* Alpine's bash requires setgid/setuid for some reason. (Setting USER environment variable did not the trick..) * In the future, we need Jail policy to be statically parsed from image-specific configuration files instead of built into the binary.
Another requirement is to use multi-staged docker builds. |
base, base-python2-minimal, base-python3-minimal, c, cpp, go, java, php7, python2, python3 images based on alpine 3.6 is pushed to docker hub. |
git, lua5 images based on alpine 3.6 is pushed to docker hub. |
For python2/python3 kernels, have you squashed the final images? |
Aha, there is an option for flattening intermediate layers. I'll re-create images with squash option. |
For some unknown reason, compiled executable binary has no execute flage when jail is wrapped around. For bypass temporarily, just chmod the executable to 755.
* All wheel packages that take long time to build are now stored inside "lablup/kernel-base-pythonX-wheels" images - Unless you change the version/list of dependent wheels, the whole build process will take much much LESS time! * The base image is updated to use latest jail and runtime UID matching entrypoint.
* Upgraded the nvidia driver of indominus to 375.26 from 367.48 * However, cudaGetDeviceCount() API fails which is called from Python ctypes with error code 35 (insufficient driver version).
* Also collect the same Python-based runner command to minimal Python base images. * Remove unused build-and-deploy.sh script and add a new build.sh script.
Closing: we now use Alpine Linux and Bitnami's minifieid Debian Linux as the base container images. |
My initial tests show that it's viable to migrate to Alpine Linux for our kernel images.
__fprintf_chk
,__vfprintf_chk
)The core ideas to reduce image size are:
apk
, and a few utililties such asscanelf
. libc is replaced with musl transparently.apk
) in Alpine Linux provides a concept of "virtual" package installation space, so we can easily purge a set of packages. Also, most Alpine Linux pacakges are made to be independent with minimal cross-dependencies.Challenges remainig:
The text was updated successfully, but these errors were encountered: