Skip to content

Shrink docker images to minimal size using essential libs only

Notifications You must be signed in to change notification settings

anuraguniyal/docker-shrink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

docker-shrink-python is a script which shrinks docker images which use python to a minimum size. It first gets all pyt
hon dependencies using pyinstaller and hen using a recursive version of ldd (lddtree.py) grabs the system dependencies. Result is a docker image sometime 1/20 or less in size.

usage:
docker-shrink-python <path-to-src-code-folder> <name-of-main-python-file> <name-of-docker-image>

lddtree approach can be used to shrink any docker image e.g. run this inside docker image to grab dependencies
$ python2.7 /usr/bin/ldtree.py --copy-to-tree /myapp/ /path/to/binary
and then /myapp/ can be used to create a new docker image

About

Shrink docker images to minimal size using essential libs only

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published