dongzhaorui 2 éve
szülő
commit
2f291ce303
1 módosított fájl, 13 hozzáadás és 11 törlés
  1. 13 11
      zgztb_cookie/FworkSpider/Dockerfile

+ 13 - 11
zgztb_cookie/FworkSpider/Dockerfile

@@ -9,11 +9,12 @@ RUN echo "alias ll='ls -hall'" >> ~/.bashrc && source ~/.bashrc
 # 更新yum源, 并生成缓存
 RUN curl -o /etc/yum.repos.d/CentOS7-Aliyun.repo http://mirrors.aliyun.com/repo/Centos-7.repo && curl -o /etc/yum.repos.d/epel-7-Aliyun.repo http://mirrors.aliyun.com/repo/epel-7.repo
 RUN yum clean all && yum makecache && yum -y update
-RUN yum install -y wget unzip dbus-x11
+RUN yum install -y wget unzip dbus-x11 kde-l10n-Chinese
 
 # Allow container to access D-Bus
 ENV DBUS_SESSION_BUS_ADDRESS=/dev/null
 
+# 开发环境安装
 WORKDIR /opt
 # 安装node, 更换npm源
 RUN curl -fsSL https://rpm.nodesource.com/setup_14.x | bash && yum -y install nodejs && npm config set registry https://registry.npm.taobao.org
@@ -21,12 +22,19 @@ RUN curl -fsSL https://rpm.nodesource.com/setup_14.x | bash && yum -y install no
 ENV NODE_PATH="/usr/lib/node_modules"
 
 # 安装 python3.8.10 gcc相关配置
-RUN yum --exclude=kernel* update -y && yum groupinstall -y 'Development Tools' && yum install -y gcc openssl-devel bzip2-devel libffi-devel gtk3 libXt kde-l10n-Chinese glibc-common sqlite-devel
+RUN yum --exclude=kernel* update -y && yum groupinstall -y 'Development Tools' && yum install -y gcc openssl-devel bzip2-devel libffi-devel gtk3 libXt glibc-common sqlite-devel
 # python3.8.10下载与解压缩
 RUN curl -o python3.8.10.tgz https://mirrors.huaweicloud.com/python/3.8.10/Python-3.8.10.tgz && tar -zxvf python3.8.10.tgz
-# 切换目录
+
+# filefox环境安装
+# 下载和解压缩火狐浏览器
+RUN wget https://download-installer.cdn.mozilla.net/pub/firefox/releases/78.0/linux-x86_64/zh-CN/firefox-78.0.tar.bz2 && tar -jxvf firefox-78.0.tar.bz2 && ln -s /opt/firefox/firefox /usr/bin/firefox
+# 下载驱动并添加可执行权
+RUN wget https://baibai.ink:88/selenium/firefox/geckodriver/0.31.0/geckodriver && chmod +x geckodriver && ln -s /opt/geckodriver /usr/bin/geckodriver
+
+# 切换python工作目录
 WORKDIR /opt/Python-3.8.10
-# 创建编译安装目录, 配置安装位置
+# 创建和指定python环境存放路径
 RUN mkdir /usr/local/python38 && ./configure --prefix=/usr/local/python38
 # 编译和安装
 RUN make -j 8 && make altinstall
@@ -37,13 +45,7 @@ RUN pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple && p
 # 虚拟环境加入系统环境变量
 ENV PATH="/usr/local/python38/bin:$PATH"
 
-# selenium filefox环境安装
-# 下载和安装火狐浏览器
-RUN wget https://download-installer.cdn.mozilla.net/pub/firefox/releases/78.0/linux-x86_64/zh-CN/firefox-78.0.tar.bz2 && tar -jxvf firefox-78.0.tar.bz2 && ln -s /opt/firefox/firefox /usr/bin/firefox
-# 下载和安装驱动
-RUN wget https://baibai.ink:88/selenium/firefox/geckodriver/0.31.0/geckodriver && chmod +x geckodriver && ln -s /opt/geckodriver /usr/bin/geckodriver
-
-# 设置编码
+# 设置系统编码
 RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
 RUN export LANG=zh_CN.UTF-8