Reputation: 536
When creating a docker, i am currently doing pip install -r requirements.txt.
Instead of pip install, can I just copy all the already installed modules in my venv of project on local host into docker? Is it equivalent or is there a difference? I am assuming here that local host is same as docker container in terms of image and configuration.
Upvotes: 0
Views: 349
Reputation: 39
It is not recommended to copy the installed modules from your host machine to the container. The code might not work if your host OS is different than the container’s base OS. Moreover you may be copying unwanted cache files, which will increase the docker image size.
Upvotes: 1