byt3bl33d3r / WitnessMe

Web Inventory tool, takes screenshots of webpages using Pyppeteer (headless Chrome/Chromium) and provides some extra bells & whistles to make life easier.
GNU General Public License v3.0
727 stars 109 forks source link

Build fails on arm64 due to httptools pip package #23

Open ghost opened 3 years ago

ghost commented 3 years ago

x64:

$ docker run --rm busybox uname -a
Linux 21232f7f703d 5.4.39-linuxkit #1 SMP TIMESTAMP x86_64 GNU/Linux
$ docker build --tag witnessme https://github.com/byt3bl33d3r/WitnessMe.git
[+] Building TIMEDURATION (13/13) FINISHED 

arm64:

$ docker run --rm busybox uname -a
Linux 790f4ba88c53 5.4.0-1022-raspi #25-Ubuntu SMP PREEMPT TIMESTAMP aarch64 GNU/Linux
$ docker build --tag witnessme https://github.com/byt3bl33d3r/WitnessMe.git
Building wheel for httptools (setup.py): started                                                      
  Building wheel for httptools (setup.py): finished with status 'error'                                 
  ERROR: Command errored out with exit status 1:                                                        
   command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-i
nstall-tabquj4g/httptools/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tabquj4g/httptools/setup.py'"'"'
;f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"')
;f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ijz37d6j        
       cwd: /tmp/pip-install-tabquj4g/httptools/                                                        
  Complete output (30 lines):                     
....etc....
The command '/bin/sh -c pip3 install -r requirements.txt' returned a non-zero code: 1

Most probable cause is tagging a binary blob for a specific architecture. In this case, it appears there is a problem with your upstream httptools pip package not having a prebuilt wheel for this architecture, and your base docker image does not have the required build tools.

x64:

$ docker run -it --rm python:3.8-slim bash
pip3 install httptools==0.1.1
Collecting httptools==0.1.1
  Downloading httptools-0.1.1-cp38-cp38-manylinux1_x86_64.whl (227 kB)
     |████████████████████████████████| 227 kB 3.3 MB/s 
Installing collected packages: httptools
Successfully installed httptools-0.1.1

arm64:

$ docker run -it --rm python:3.8-slim bash
pip3 install httptools==0.1.1                                                      
Collecting httptools==0.1.1                                                                             
  Downloading httptools-0.1.1.tar.gz (106 kB)                                                           
     |████████████████████████████████| 106 kB 1.6 MB/s                                                 
Building wheels for collected packages: httptools                                                       
  Building wheel for httptools (setup.py) ... error 
  ERROR: Command errored out with exit status 1:  

This pip package installs correctly using the full-size base image instead of slim:

arm64:

docker run -it --rm python:3.8 bash
pip3 install httptools==0.1.1  
Collecting httptools==0.1.1
  Downloading httptools-0.1.1.tar.gz (106 kB)
     |████████████████████████████████| 106 kB 2.1 MB/s 
Building wheels for collected packages: httptools
  Building wheel for httptools (setup.py) ... done
  Created wheel for httptools: filename=httptools-0.1.1-cp38-cp38-linux_aarch64.whl size=278614 sha256=c9035d9d96782c9b8e55aa09decf4c30bb7d57497717deb2a5d78ae0087adff0
  Stored in directory: /root/.cache/pip/wheels/16/d9/1d/1cc7690d9e6ef93fcaed984a4f46cedd1d55e8ba03c1ccc48f
Successfully built httptools
Installing collected packages: httptools
Successfully installed httptools-0.1.1

Forking the repo and only changing the docker base image to be python:3.8 instead of python:3.8-slim: https://github.com/byt3bl33d3r/WitnessMe/compare/master...kairzha:master

arm64:

docker build --tag witnessmek https://github.com/kairzha/WitnessMe.git
Successfully tagged witnessmek:latest