【问题标题】:scapy won't install on dockerfilescapy 不会安装在 dockerfile 上
【发布时间】:2022-10-16 22:27:54
【问题描述】:

我正在尝试在使用 scapy 的 docker 容器上运行 python 代码。但是由于某种原因,当我试图在我的Dockerfile 上安装包时,应该安装包的命令会永远运行。这是运行命令docker build -t image . 时的样子: Image from terminal
有人可以帮我解决这个问题吗

我的 Dockerfile

FROM ubuntu:latest

ADD server.py .
RUN apt-get update
RUN apt-get upgrade
RUN apt-get -y install python3
RUN apt-get -y install python3-pip
RUN apt-get -y install python3-scapy

【问题讨论】:

  • 1)请不要将错误发布为图像。 2)错误表明它显然正在等待您的输入。也许 scapy 有一个非交互式安装选项?
  • 如何找到该安装类型?我在这类事情上真的没有太多经验,如果你能帮助我,我将不胜感激。
  • 为什么错误不能发布为图片?
  • 我可以将该输入添加到命令中而不是寻找非交互式安装吗?

标签: docker dockerfile docker-image


【解决方案1】:

我通过将这两行添加到 Dockerfile 成功地解决了这个问题。

Dockerfile:

FROM ubuntu:latest

ENV TZ=Europe/Kiev
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

ADD server.py .

RUN apt-get update
RUN apt-get upgrade
RUN apt-get -y install python3
RUN apt-get -y install python3-pip
RUN apt-get -y install python3-scapy

【讨论】:

    猜你喜欢
    • 2021-09-16
    • 2021-09-11
    • 2023-02-17
    • 1970-01-01
    • 1970-01-01
    • 2021-06-12
    • 1970-01-01
    • 1970-01-01
    • 2022-08-09
    相关资源
    最近更新 更多