在构建Python3.6环境的docker镜像时遇到python-devel无法安装
使用hub.c.163.com/library/centos:latest版本无法安装,换成hub.c.163.com/public/centos:6.7-tools版本即可完成安装
Dockerfile的代码:
FROM hub.c.163.com/public/centos:6.7-tools
MAINTAINER liu xxx@163.com
#下载安装包并且创建python的运行环境
RUN wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
RUN tar -xzvf Python-3.6.0.tgz
RUN yum install gcc -y
RUN yum install zlib* -y
RUN yum install openssl* -y
#安装Python
RUN ./Python-3.6.0/configure --prefix=/usr/local
&& make
&& make install
#创建Python文件的存放目录
RUN mkdir -p /workspace/python_file
COPY test /workspace/python_file
#安装Python的相关库
RUN pip3 install numpy
&&pip3 install BeautifulSoup4
&&pip3 install requests
&&pip3 install bs4