1. Preparation 1.1 Download the Python installation package (Note: the Python version can be changed according to your needs) Download from official website: https://www.python.org/downloads/source/ Local download address: 64-bit: https://www.jb51.net/softs/416037.html 32-bit: https://www.jb51.net/softs/543679.html 1.2Base image Ubuntu16.04 DockerHub pull docker pull ubuntu:16.04 Local Ubuntu download address: https://www.jb51.net/softs/532597.html docker load < ubuntu1604.tar 2. Production process 2.1 Dockerfile Writing FROM ubuntu:16.04 MAINTAINER cc-man #Add Python installation package ADD Python-3.5.0.tar.xz /opt #Update apt RUN apt-get update && apt-get install -y #Install dependencies RUN apt-get install gcc -y && apt-get install make -y \ && apt-get install vim -y && apt-get install openssl -y \ && apt-get install libssl-dev -y && apt-get install python3-pip -y RUN ./opt/Python-3.5.0/configure --prefix=/usr/local/python3.5 \ && make && make install RUN mkdir /opt/myApp/ VOLUME ["/opt/myApp/"] CMD [""] Note: The python version can be changed according to your needs 2.2 Production docker build -t ubuntu-16.04/python:3.5 . Note: The image creation process requires downloading dependencies so you need to wait for a while. success: 2.3 View the image 2.3.0 View docker images 2.3.1 Entering the image 1. Enter the container docker run -i -t -v /root/software/:/mnt/software/ 117cbe7ba93b /bin/bash 2. Check the pip version pip -V 3. Run Python 1.1 python3.5 1.2 print("hello world") At this point we have completed the production of the Python basic environment image The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: A brief introduction to the command line tool mycli for operating MySQL database
>>: Use native js to simulate the scrolling effect of live bullet screen
uninstall First, confirm whether it has been inst...
1. Display effect: 2, html structure <div clas...
1. Documentation Rules 1. Case sensitive. 2. The a...
After installing the MySQL database using the rpm...
Table of contents 1. querySelector queries a sing...
Overview: I drew lessons from several timetable s...
TABLE> <TR> <TD> <TH> <CA...
1. Rounded Corners Today's web designs are con...
What is the Vendor Prefix? Vendor prefix—Browser ...
Table of contents 1. Preparation: 2. Source code ...
I would like to share with you the graphic tutori...
Table of contents 1. Introduction to MySQL Index ...
MySQL is the most popular relational database man...
Table of contents Initialize computed Dependency ...
Table of contents 1. Test Data 2. The inconvenien...