Giter Club home page Giter Club logo

fetchy's Introduction

Fetchy - Minuscule images made trivial

Why Fetchy?

Fetchy can be used to build minimal docker images with the minimal set of dependencies required, significantly reducing the size of your Docker images.

Furthermore, it is possible to customize the operating system, architecture and operating system version to fetch the latest (secure) packages from a package mirror.

How does Fetchy work?

Fetchy works by downloading debian / ubuntu packages based on some parameter you supply Fetchy. For example, if you tell fetchy to use ubuntu as a distribution and bionic as its version and download python Fetchy will look for available packages under python and download the packages required to run python. Then, if tasked to do so, Fetchy will extract the files of all the packages and wrap them in a Docker image.

Does Fetchy have any effect on my system?

No, files will only be downloaded temporarily.

Furthermore, a folder will be created under ~/.fetchy for caching.

Installing

Fetchy can be installed by running the following command:

Any of:

pip3 install fetchy
pip install fetchy
python3 -m pip install fetchy

Examples

Some existing images can be found here https://github.com/ThomasKluiters/fetchy-images

Fetchy can be used as a command line utility, though, it also offers an API.

Create a minimal docker image for a python environment based on your current operating system and architecture.

fetchy dockerize python

You can specify multiple packages:

fetchy dockerize python3.6 postgresql

Download required packages for libc6 into a specific directory

fetchy download --out libc-packages libc6

If you want to build a docker image based on another operating system (debian stretch in this example), this is also possible:

fetchy dockerize --distribution debian --version stretch openssl

Advanced features

Excluding dependencies

If some packages are unwanted, you can simply exclude them:

Using a name:

fetchy dockerize --exclude dpkg --exclude perl-base python3

It is also possible to create an exclusion file, where each line denotes a dependency that should not be included:

exclusions.txt

perl-base
dpkg

Using a name:

fetchy dockerize -exclude exclusions.txt python3

Note: exclusion files MUST end with a .txt extension!

Using PPA's

If some packages are not available for your main mirror, try using a ppa:

Using a name:

fetchy dockerize --ppa deadsnakes python3.8

Using a URL:

fetchy dockerize --ppa https://deb.nodesource.com/node_10.x nodejs

Or both!

fetchy dockerize --ppa https://deb.nodesource.com/node_10.x --ppa deadsnakes python3.8 nodejs

Developing

Fetchy uses poetry to build all sources and collect all requirements. The project can be set up through the following sequence of commands:

pip install poetry
git clone https://github.com/ThomasKluiters/fetchy
cd fetchy
poetry install
poetry shell

Backlog

  • Docker integration [x]

fetchy's People

Contributors

thomaskluiters avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.