GrayHatHacking / GHHv6

Gray Hat Hacking v6
142 stars 48 forks source link

Chapter 26 - Not able to create image with provided Dockerfile #8

Closed programadordegp2 closed 6 months ago

programadordegp2 commented 6 months ago

After cloning repository and then building the image with sudo docker build -t kali ., as explained in page 541, the following error is shown:

--------------------

   7 |     RUN pip install construct fixedint crc32c portion pwntools

   8 |     RUN apt install -y libpixman-1-dev libglib2.0-dev

   9 | >>> RUN /bin/bash -c "git clone --depth 1 --branch v5.1.0-rc3 https://github.com/qemu/qemu.git && mkdir qemu/build && cd qemu/build && ../configure --target-list=x86_64-softmmu --enable-debug --disable-strip && make && make install"

  10 |     RUN /bin/bash -c "cd /labs && make"

  11 |     

--------------------

ERROR: failed to solve: process "/bin/sh -c /bin/bash -c \"git clone --depth 1 --branch v5.1.0-rc3 https://github.com/qemu/qemu.git && mkdir qemu/build && cd qemu/build && ../configure --target-list=x86_64-softmmu --enable-debug --disable-strip && make && make install\"" did not complete successfully: exit code: 1

I have tried figuring out the conflictive instruction by dissecting line by line the Dockerfile and running multiple RUN commands, without success. Any suggestions? Thanks a lot!

My dissection:

RUN cd /qemu/build
RUN ./configure --target-list=x86_64-softmmu --enable-debug --disable-strip
RUN cd /qemu/build && make
RUN cd /qemu/build && make install
COPY . /labs
RUN ls -la /labs
RUN cd /labs && make

The error is: ERROR: failed to solve: process "/bin/sh -c ./configure --target-list=x86_64-softmmu --enable-debug --disable-strip" did not complete successfully: exit code: 127

ergot86 commented 6 months ago

Disabling "warnings as errors" in configure seems to prevent this issue. Please try the changes in the Dockerfile that I just pushed and let me know if the problem persists.

programadordegp2 commented 6 months ago

Hi!

Thanks for the response @ergot86 !!

It seems it worked fine and the image is now created. :)

Thanks a lot!

ergot86 commented 6 months ago

Glad to hear it worked :)

Closing this issue.