Home>

I'm currently using a Mac, and I'm thinking of creating an Ubuntu environment using Docker and running programs in it.
What version of pyhton i am using inside the Docker container
I wanted to unify.
The following is the reference material.
Reference material

In addition, the created Docker File is as follows.

FROM ubuntu: 20.04
#Prevent installer from asking questions
ARG DEBIAN_FRONTEND = noninteractive
ENV TZ = Asia/Tokyo
ENV PATH Library/Frameworks/Python.framework/Versions/3.7/bin: ${PATH}
RUN apt-get update
RUN apt-get install -y \
    build-essential \
    libopencv-dev \
    libtesseract-dev \
    python3-dev \
    python3-opencv \
    python3-pip \
    tesseract-ocr \
    poppler-utils
RUN rm -rf/var/lib/apt/lists/*
RUN pip3 install --no-cache-dir -r requirements.txt

I used the above file, but the installed python is 3.8.
How to specify ubuntu version and also python version
I would like you to tell me.
I think I'm still doing something crazy with little programming and peripheral knowledge,
I would appreciate it if you could tell me something that would be helpful. Thank you.

  • Answer # 1

    Is there any reason to stick to the Ubuntu environment?
    For the time being, if you only need an environment where Python can run, I think that you should directly use the Python image of docker hub.

    The tags 3.8.6-slim-buster, 3.8-slim-buster, 3.8.6-slim, 3.8-slim, 3.8.6-buster, 3.8-buster are based on Debian (Ubuntu's mother). You can also use them.