gpt4 book ai didi

Python scrapy+selenium scraper docker build 报错(错误码100)

转载 作者:行者123 更新时间:2023-12-04 18:48:44 35 4
gpt4 key购买 nike

我正在尝试将 python 刮板部署到需要 selenium geckodriver 和 firefox 的 docker。
我在尝试构建 docker 镜像时遇到 docker error 100。
这是 docker 代码

FROM scrapinghub/scrapinghub-stack-scrapy:1.3-py3
#RUN apt-get install -y apt-transport-https unzip
RUN apt-get install unzip
RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list

#============================================
# Firefox and Geckodriver
#============================================
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl firefox-esr \
&& rm -fr /var/lib/apt/lists/* \
&& curl -L https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz | tar xz -C /usr/local/bin \
&& apt-get purge -y ca-certificates curl

ENV TERM xterm
ENV SCRAPY_SETTINGS_MODULE <my_project_name>.settings
RUN mkdir -p /app
WORKDIR /app
COPY ./requirements.txt /app/requirements.txt
RUN pip install -r requirements.txt
COPY . /app
RUN python setup.py install
这是最终出现在我的终端上的日志
Error The command '/bin/sh -c apt-get update                              && apt-get install -y --no-install-recommends ca-certificates curl firefox-esr  && rm -fr /var/lib/apt/lists/* 
&& curl -L https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz | tar xz -C /usr/local/bin && apt-get purge -y ca-certificates curl'
returned a non-zero code: 100:
{'code': 100, 'message': "The command '/bin/sh -c apt-get update && apt-get install -y --no-install-recommends ca-certificates curl firefox-esr && rm -fr /var/lib/apt/lists/*
&& curl -L https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz | tar xz -C /usr/local/bin
&& apt-get purge -y ca-certificates curl' returned a non-zero code: 100"}

最佳答案

我在运行 docker build . 时遇到了同样的问题它直接给了我以下指向问题的日志行:#9 23.59 W: GPG error: http://archive.debian.org jessie Release: The following signatures were invalid: KEYEXPIRED 1587841717如果我删除该行:RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list然后它似乎是行为。

关于Python scrapy+selenium scraper docker build 报错(错误码100),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68246328/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com