AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-943123

Jay's questions

Martin Hope
Jay
Asked: 2021-12-04 04:21:03 +0800 CST

docker - nodejs - selenium-webdriver - 错误:服务器提前终止,状态为 127

  • 0

我是码头集装箱的新手。我正在尝试创建一个包含 npm、node js、chromedriver 和 selenium-chromedriver 的 docker 文件并运行我的 javascript 文件。在我的本地,我在无头 chrome 浏览器中运行脚本。

这是我的码头文件。

FROM ubuntu:20.04

USER root

WORKDIR /home/app

RUN apt-get update
  
RUN apt-get install git --yes

# Install Google Chrome
RUN apt-get install wget
RUN apt-get install ./google-chrome*.deb --yes
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -P /usr/bin/ && \ dpkg --unpack google-chrome-stable_current_amd64.deb && \ apt-get install -f -y,

#FROM node:14.18.0
FROM node:17.2.0
USER root
ENV NODE_ENV=production
WORKDIR /LoadTesting
COPY ["/LoadTesting/package.json", "."]
RUN npm install
RUN npm ci
RUN npm install nodejs
RUN npm install mocha -g
RUN npm install chromedriver -g --unsafe-perm
RUN npm install selenium-webdriver


COPY /LoadTesting .
COPY /LoadTesting/test .
CMD ["node", "./test/script.js"]

以下是我的码头工人撰写文件

version: '3.7'

services:
  k6:
    image: "loadimpact/k6:0.32.0"
    volumes:
      - "./loadtesting:/scripts"
  nodejs:
    build:
      context: ./
      dockerfile: k6-nodejs-dockerfile
    volumes:
      - '.loadtesting:/loadtesting'

volumes:
  grafana-storage:
  prometheus-data:
    external: true

然后我使用以下命令

docker compose build //no error
docker compose up k6 nodejs

然后我得到以下错误。

| /LoadTesting/node_modules/selenium-webdriver/remote/index.js:248
-nodejs-1  |                 reject(Error(e.message))
-nodejs-1  |                        ^
-nodejs-1  |
-nodejs-1  | Error: Server terminated early with status 127
-nodejs-1  |     at /LoadTesting/node_modules/selenium-webdriver/remote/index.js:248:24
-nodejs-1  |     at processTicksAndRejections (node:internal/process/task_queues:96:5)

在我的本地 Windows 环境中,它工作正常。据我所知,我正在安装 chrome、chrome 驱动程序和 selenium-webdriver。

什么不见​​了?

docker docker-compose node.js selenium
  • 1 个回答
  • 766 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve