4

I am trying to build the following Radare2 dockerfile, but I think I may have some formatting wrong. I can't seem to figure out how to make everything install correctly and build. Any help would be appreciated.

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"

I get the following error when I try to build this 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
Increasingly Idiotic
  • 5,700
  • 5
  • 35
  • 73
Devin Zane
  • 41
  • 2

2 Answers2

3

The pip install lines are new commands to use RUN keyword, not part of apt-get, so you need to remove the previous backlash and add RUN before the lines. Try this:

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"
gcw
  • 1,639
  • 1
  • 18
  • 37
1

or better in a single RUN instruction:

RUN apt-get update && \
  apt-get install -y \
  build-essential \
  (...)
  lsb-core \
&& pip install --upgrade pip \
&& pip install --upgrade pwntools 
RzR
  • 3,068
  • 29
  • 26