this is my docker file:
WORKDIR /scan
RUN pip install pymongo
RUN pip install netmiko
RUN pip install pyats[full]
ENV Testbed=
ENV arr=
# ENV device=
# ENV id=
COPY . /scan
ENTRYPOINT ["python3", "main.py"]
I want to pip install this particular packages locally Like from a tar files. I want to build the image without any internet, so that’s why I need it to be locally so that the pip will take them from local and not from internet.
I just want to clarify that when I pip install requirements it will go anyway to the internet, I already try it.
2
Answers
You need base image in dockerfiles:
For running any commands in the process of building docker image (keyword RUN):
Build you docker images from a internet PC:
Save the built image:
In you case:
Then copy your image to a new system (which has no internet access) with regular file transfer tools such as
cp
,scp
, orrsync
(preferred for big files). After that you will have to load the image into Docker:Then you can use the
run
command to start the image.