Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

install python in docker file

Generic Dockerfile template
Finally to give a comprehensive answer, note that a good practice regarding Python dependencies consists in specifying them in a declarative way in a dedicated text file (in alphabetical order, to ease review and update) so that for your example, you may want to write the following file:

requirements.txt

matplotlib
med2image
nibabel
pillow
pydicom
and use the following generic Dockerfile

FROM python:3

WORKDIR /usr/src/app

COPY requirements.txt ./

RUN pip install --no-cache-dir --upgrade pip 
  && pip install --no-cache-dir -r requirements.txt

COPY . .

CMD ["python", "./your-daemon-or-script.py"]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #install #python #docker #file
ADD COMMENT
Topic
Name
9+2 =