Dockerfile构建错误:无法找到

时间:2017-10-25 16:23:41

标签: dockerfile docker-build radare2

我正在尝试构建以下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

2 个答案:

答案 0 :(得分:1)

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"

答案 1 :(得分:0)

单个RUN指令中的

或更好:

RUN apt-get update && \
  apt-get install -y \
  build-essential \
  (...)
 lsb-core \
&& pip install --upgrade pip \
&& pip install --upgrade pwntools