4

我正在尝试构建以下 Radare2 dockerfile,但我认为我可能有一些格式错误。我似乎无法弄清楚如何正确安装和构建所有内容。任何帮助,将不胜感激。

FROM radare/radare2

USER root

RUN apt-get update && \
 apt-get install -y \
 build-essential \
 nasm \ 
 gdb \ 
 python \
 python-pip \
 python-dev \
 vim \
 git \
 libffi-dev \
 libssl-dev \
 libc6-i386 \
 lsb-core \
 pip install --upgrade pip \
 pip install --upgrade pwntools \
 libc6-dev-i386 
USER r2


RUN git clone https://github.com/longld/peda.git ~/peda && \
 echo "source ~/peda/peda.py" >> ~/.gdbinit

RUN \
"/bin/bash"

尝试构建此 dockerfile 时出现以下错误:

E: Unable to locate package pip
E: Unable to locate package install
E: Unable to locate package pip
E: Unable to locate package pip
E: Unable to locate package install
E: Unable to locate package pwntools
4

2 回答 2

3

这些pip install行是使用关键字的新命令RUN,而不是 的一部分apt-get,因此您需要删除以前的反斜杠并在行之前添加RUN。尝试这个:

FROM radare/radare2

USER root

RUN apt-get update && \
 apt-get install -y \
 build-essential \
 nasm \ 
 gdb \ 
 python \
 python-pip \
 python-dev \
 vim \
 git \
 libffi-dev \
 libssl-dev \
 libc6-i386 \
 libc6-dev-i386 \
 lsb-core

RUN pip install --upgrade pip
RUN pip install --upgrade pwntools

USER r2

RUN git clone https://github.com/longld/peda.git ~/peda && \
 echo "source ~/peda/peda.py" >> ~/.gdbinit

RUN "/bin/bash"
于 2017-10-25T16:33:51.890 回答
1

或在单个 RUN 指令中更好:

RUN apt-get update && \
  apt-get install -y \
  build-essential \
  (...)
  lsb-core \
&& pip install --upgrade pip \
&& pip install --upgrade pwntools 
于 2017-11-08T10:59:30.793 回答