Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium WebDriverException:消息:无效参数:can';t kill Docker容器中已退出的进程返回奇数错误_Selenium_Docker_Containers_Dockerfile - Fatal编程技术网

Selenium WebDriverException:消息:无效参数:can';t kill Docker容器中已退出的进程返回奇数错误

Selenium WebDriverException:消息:无效参数:can';t kill Docker容器中已退出的进程返回奇数错误,selenium,docker,containers,dockerfile,Selenium,Docker,Containers,Dockerfile,我正在运行一个小型Python脚本,它从一个公共网站上获取一些数据 当我使用selenium:latest图像在交互式终端中逐行运行Dockerfile指令时,脚本运行良好 docker run-it-v/Users/me/Desktop/code/scraper/:/scraper selenium/standalone firefox bash 当我使用Dockerfile和docker compose文件运行它时,我收到以下错误: app_1 | selenium.common.exce

我正在运行一个小型Python脚本,它从一个公共网站上获取一些数据

当我使用selenium:latest图像在交互式终端中逐行运行Dockerfile指令时,脚本运行良好

docker run-it-v/Users/me/Desktop/code/scraper/:/scraper selenium/standalone firefox bash

当我使用Dockerfile和docker compose文件运行它时,我收到以下错误:

app_1  | selenium.common.exceptions.WebDriverException: Message: invalid argument: can't kill an exited process
我正在使用MOZ_HEADLESS=1 env变量。它被正确地传递

我尝试以root以外的其他人的身份运行脚本,但随后出现日志错误

Dockerfile

FROM selenium/standalone-firefox:latest


# https://github.com/SeleniumHQ/docker-selenium/issues/725
USER root

RUN apt-get update -y
RUN apt-get install -y firefox python-pip

WORKDIR /scraper

COPY . /scraper
RUN pip install -r /scraper/requirements.txt

ENV MOZ_HEADLESS=1
CMD ["python", "/scraper/browserscraper.py"]
如果我从交互式终端在Dockerfile中运行这些指令,我就没有问题

这要么是因为用户是root用户,通过Dockerfile运行脚本,要么是因为它缺少一个输出屏幕,因为我实际上没有SSH,就像我在命令行中使用
-It
运行脚本一样

有什么想法吗