I am looking for some help in writing docker file for Ubuntu 18.04 version which installs Python3.10.
Currently it is written in such a way that it gets the default version of the Python3 (i.e. 3.6) along with the ubuntu 18.04.
Here the question is, is there any way that I can get the Python3.10 with Ubuntu 18.04? The requirement is to use either slim or non-slim versions of Python3.10 Bulls eye image from docker hub
2
Answers
I am able to build the image on ubuntu 18.04 by including python3.10
Step-1: Write a docker file FROM python:3.10-bullseye RUN mkdir WORK_REPO RUN cd WORK_REPO WORKDIR /WORK_REPO ADD hi.py . CMD ["python", "-u", "hi.py"]
Step-2: Build the image docker build -t image_name .
Step-3: Run the docker image docker run image_name
Step-4: Connect to the container and check the Python version
I hope this would be helpful for someone who is completely new in writing dockerfile.
Many Thanks, Suresh.
you can use ubuntu 18 docker image, then install python 3.10 inside it.