#注意 yum install -y ,,,
yum-builddep -y python
FROM dockerhub.datagrand.com/global/centos:7.2.1511 #作者标签,有问题就找他 LABEL maintainer "[email protected]" #环境变量硬编码及时区 ENV ENVIRONMENT production RUN cd / && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime #yum 基础工具,记住clean RUN rpm --rebuilddb \ && yum clean all \ && yum makecache \ && yum install -y wget gcc gcc-c++ python-devel mysql-devel bzip2 make cyrus-sasl-devel \ && yum clean all #安装python3 RUN rpm --rebuilddb \ && yum clean all \ && yum makecache \ && yum install -y yum-utils \ && yum-builddep -y python \ && curl -O https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz \ && tar xf Python-3.7.1.tgz \ && cd Python-3.7.1 \ && ./configure \ && make \ && make install WORKDIR /app COPY . /app #pip 基础工具及版本 RUN pip3 install --trusted-host pypi.python.org -r requirements.txt EXPOSE 80 CMD ["python3", "main.py"]