发布时间:2019-09-12 07:54:07编辑:auto阅读(2567)
docker pull ubuntu:16.04
docker load < ubuntu1604.tar
2.1 Dockerfile编写
FROM ubuntu:16.04
MAINTAINER cc-man
#添加python的安装包
ADD  Python-3.5.0.tar.xz /opt 
#更新apt
RUN  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 -y
RUN  ./opt/Python-3.5.0/configure --prefix=/usr/local/python3.5 \
		&& make && make install
RUN mkdir /opt/myApp/
VOLUME ["/opt/myApp/"]
CMD [""]
说明:python版本可根据自己需求更换
2.2 制作
docker build -t ubuntu-16.04/python:3.5 .
注意:镜像制作的过程需要下载依赖所以需要等待一段时间。

成功:

2.3 查看镜像
2.3.0 查看
docker images

2.3.1 进入镜像内部
1.进入容器
docker run -i -t -v /root/software/:/mnt/software/ 117cbe7ba93b /bin/bash
2.查看pip版本
pip -V

3.运行python
1.1
python3.5
1.2
print("hello world")

上一篇: python生成带有表格的图片
下一篇: ARM入门笔记(3)
 51194
 50609
 41233
 38051
 32513
 29420
 28281
 23136
 23094
 21432
 1489°
 2202°
 1825°
 1753°
 2064°
 1813°
 2499°
 4193°
 4055°
 2894°