创建Dockerfile文件
##############################################
# 基于centos7、python3构建scrapy、scrapyd运行环境
# 构建命令: 在Dockerfile文件目录下执行 docker build -t centos7-python3-scrapyd .
# 容器启动命令: docker run -dit --name scrapyd --restart=always --privileged=true centos7-py3-scrapyd
# 进入容器:docker exec -it scrapyd /bin/bash
##############################################
FROM centos:7.6.1810
MAINTAINER sgs # 指定作者信息
RUN set -ex \
# 预安装所需组件
&& yum install -y wget tar unzip libffi-devel zlib-devel bzip2-devel openssl-devel ncurses-devel \
sqlite-devel readline-devel tk-devel gcc make initscripts vim cronie lrzsz rsyslog \
# && wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz \
&& wget https://mirrors.huaweicloud.com/python/3.7.4/Python-3.7.4.tgz \
&& tar -zxvf Python-3.7.4.tgz \
&& cd Python-3.7.4 \
&& ./configure prefix=/usr/local/python3 \
&& make \
&& make install \
&& make clean \
&& rm -rf /Python-3.7.4* \
&& yum install -y epel-release \
&& yum install -y python-pip \
&& yum clean all && rm -rf /var/cache/yum/* && rm -rf /tmp/*
# 基础环境配置
RUN set -ex \
# 修改系统时区为东八区
&& rm -