Using local package for Docker's requirements file -


i have cloned open-source project called flasgger (https://github.com/rochacbruno/flasgger) local folder. , added changes it.

now run docker using requirments.txt:

docker run \     ...     -r requirements.txt \     .... 

before clone requirements.txt looked like:

flasgger==0.6.5 

and download , use flasgger internet.


question: how modify requirements.txt use local copy of flasgger?

ideally run python setup.py bdist_wheel in custom flasgger source , upload generated .whl-file private python package repository can install pip in dockerfile (devpi easy set up)

to install python package private package repo:

run pip install --index-url <url repo> <package name==version> 

or

run pip install --index-url <url repo> -r custom-requirements.txt 

the advantage package repo can build , tag versions of packages ability roll or delay upgrades.

a cheaper alternative copy in .whl file in image , install pip.

it's possible install package pip referencing git repo or url. add url requirements file.

in local development can of course map package directory directly container.

you bump same issue when split project multiple packages services/containers share packages. local package repo solves entirely. juggling lots of .whl files locally turns nightmare.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -