In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how Docker makes the basic image of Python operating environment, I believe most people do not know much about it, so share this article for your reference. I hope you will learn a lot after reading this article. Let's learn about it together.
I. preparatory work
Download the Python installation package (note: the python version can be changed according to your own needs)
Download from the official website: https://www.python.org/downloads/source/
1.2 basic 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.1 Dockerfile编写 FROM ubuntu:16.04MAINTAINER cc-man#添加python的安装包ADD Python-3.5.0.tar.xz /opt #更新aptRUN apt-get update && apt-get install -y #安装依赖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 -yRUN ./opt/Python-3.5.0/configure --prefix=/usr/local/python3.5 \ && make && make installRUN mkdir /opt/myApp/VOLUME ["/opt/myApp/"]CMD [""] 说明:python版本可根据自己需求更换 2.2 制作 docker build -t ubuntu-16.04/python:3.5 . 注意:镜像制作的过程需要下载依赖所以需要等待一段时间。 成功:2.3 View Mirror
2.3.0 View
Docker images
2.3.1 enter inside the image
1. Enter the container
Docker run-I-t-v / root/software/:/mnt/software/ 117cbe7ba93b / bin/bash
two。 View pip version
Pip-V
3. Run python
1.1
Python3.5
1.2
Print ("hello world")
The above is all the contents of the article "how to make the basic Image of Python running Environment by Docker". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.