A setuptools extension for building docker images for distribution
Project description
setuptools-docker
A light-weight setuptools extension for building docker images from python projects.
Python wheels are the preferred packaging format for distributing python libraries or applications. However, in cloud native computation services get packaged and deployed as docker/oci images. This project aims at making the packaging of python services for such environments as easy and as repeatable as building a wheel. It takes heavy inspiration from jib.
Usage
setuptools-docker extends setuptools with one additional command:
bdist_docker
. It will typically be used like this:
python -m setup bdist_docker
For a reference of arguments see python -m setup bdist_docker --help
Configuration via file
setuptools-docker utilizes the configuration mechanisms of setuptools
itself, e.g., setup.cfg
.
It adds a new section [bdist_docker]
, e.g.:
[bdist_docker]
extra_requires =
gunicorn
user_id = 1100
environment_vars =
FIZZ=BUZZ
Options
Key | Type | Description | Default |
---|---|---|---|
image_name | str | image name (optionally incl. registry) | metadata name |
image_tag | str | image tag | metadata version |
requirements_file | str | pip requirements file to install into image | |
extra_requires | list | extras to install alongside wheel | |
index_url | str | pip index url to install dependencies from | (pip default index) |
index_username | str | username for authentication to PIP index | |
index_password | str | password for authentication to PIP index | |
base_image | str | base image for final stage | python:3.8-slim-bullseye |
extra_os_packages | list | extra deb packages to install into final stage | |
builder-extra-os-packages | list | extra deb packages to install into builder stage | |
user_id | int | user id for docker USER directive | |
entrypoint | list | entrypoint in exec form | |
command | list | command in exec form | |
init_scripts | list | path/to/extra/init/scripts to run (prior to provided entrypoint ) | |
pip_cache_docker | bool | whether to use docker cache for pip cache dir | True |
environment_vars | list | environment variables to set via docker ENV directive |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file setuptools_docker-0.1.0.tar.gz
.
File metadata
- Download URL: setuptools_docker-0.1.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d6d9e7846c8fd646956d583ba5c79f07889be41db4bd1d08b0ffe64ea7708b1 |
|
MD5 | 1bc7e8db1e905ac6f9afcb1dabdaf5d4 |
|
BLAKE2b-256 | a507ffa1b5e1b156a96fd6b3737c4dfdbc84e4b5fcdc31b1b0a150dde600bd67 |
File details
Details for the file setuptools_docker-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: setuptools_docker-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 390c8c074bf3e0139fcbc82fb1b1ad8b963813116b76ac892c9c3b6a840922f4 |
|
MD5 | 13ea29e032c2a53631669973d355f4e8 |
|
BLAKE2b-256 | 53c2f3831f271e55cd80845fa6ddda3acce4ee9cb5ae5e2a2162c1a9515b13bc |