Using Calibre ebook-convert without other dependencies


I’m trying to package a Python application, which depends on a Calibre command, ebook-convert.
After creating a docker image, I realized that the image was twice the size of a plain Dockerfile build. The problem is that it’s linking all of the Calibre dependencies for speech-dispatcher, doubling the whole package’s size. How can I use only a subset of commands (in this case, a single one) from this package and leave out the dependencies for the not-used ones from my image?

In general, you will need to depend on a different derivation for that dependency, one that overrides the relevant default build with ones more suitable for your needs. Depending on the specifics of that package (and your needs) this might need a simple override, overrideAttrs, or more extensive overlay.

Which will almost certainly result in you needing to build that from source as it will miss the hydra cache.

1 Like