I want to create a docker image (docker version: 20.10.20)that contains python libraires from a requirement.txt file that contains 50 libraries. Without facing root user permissions how can proceed. Here is the file:
From ubuntu:latest
RUN apt update
RUN apt install python3 -y
WORKDIR /Destop/DS
# COPY requirement.txt ./
# RUN pip install -r requirement.txt
# it contains only pandas==1.5.1
COPY script2.py ./
CMD ["python3", "./script2.py"]
It failed at requiremnt.txt command *error it takes lot of time while creating image. because it ask for root permission.
python:3.7-alpinebase image in yourDockerfileFROM python:3.7-alpineto save you from the hassle of writing separate service forpythonin yourdocker-compose. You dont need to use anubuntubase image and thedocker-composecould be cleaner that way