J
J
Jekson2020-12-29 10:27:26
Python
Jekson, 2020-12-29 10:27:26

How to install local library in docker?

When a container is created, dependencies from the pip repository are installed in the virtual environment. One of the libraries was customized locally and to check its performance, you need to use it instead of the Pip lib.
in dockerfile
.

..
....
RUN \
    apk add --no-cache --virtual .build-deps \
        curl \
    && \
    pip install -U -r /home/httpd/app/packages \
...


and the list of dependencies is specified in the packages
file. Is it possible to specify the path to the local library separately in this file so that the docker installer can use it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
zohan1993, 2020-12-29
@Lepilov

Dockerfile

COPY /package_1_src  /path/to/package_1/package_1_src

packages file
package_1 @ file:///path/to/package_1/package_1_src

J
Jek, 2020-12-29
@jotrib

You need to make a shared folder between the docker and the host, and install from there

M
mkone112, 2020-12-29
@mkone112

pip, by the way, can install from github, for example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question