-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Question] What is the best practice to add a custom Debian package to the distroless image? #1321
Comments
What distroless does with debian packages is extract
|
I'm educatin myself about debian from here: https://www.debian.org/doc/manuals/debian-faq/pkg-basics.en.html This is what I'm thinking, please let me know if my idea is right:
|
@LucaMaurelliC What you're attempting doesn't really fit the intent of Distroless images, which best supports use cases where a single app is built, and the resulting files then copied on top of the Distroless base image directly. You'd probably have a much easier time if you simply use a lightweight and well-maintained base image, like Alpine or Ubuntu. You could theoretically do what you're asking on top of Distroless, but it would be a lot of work. You'd probably want to install the necessary packages and all of its dependencies in the standard Debian image as part of an intermediate stage in the Dockerfile. You'd then need to figure out EVERY file that was created by all those package installs and |
Thanks @chris-harness for the insight. At the moment, I am using the official python slim image based on debian to run my "single application", which is basically python code (managed with a pip package manager) and the mssql driver to handle the database within the app itself. I can copy the app files by installing the python packages in a virtual enviroment: this is already done. The SQL database driver, instead, is installed separately by using system-level package, in my image with Debian utilities (e.g. apt-get). Do you think this configuration is not suited (and should not be suited) with distroless images? |
Very interesting discussion. i would like to install |
https://github.com/bazel-contrib/rules_debian_packages does the job. In my case I added the mysql client to the distroless python base image as follows:
|
I wish to install some database' clients, e.g. mssql or postgres, how can I add them to one of the distroless images?
The text was updated successfully, but these errors were encountered: