binaryanalysis-ng icon indicating copy to clipboard operation
binaryanalysis-ng copied to clipboard

Docker issues

Open seihtam opened this issue 4 years ago • 1 comments

I tried to get binaryanalysis-ng working in docker. Here are the problems i encountered:

  1. The docker instructions in the README doesn't work
  2. In Dockerfile.kaitai the filename kaitai-struct-compiler-0.10-SNAPSHOT.zip is hardcoded but have since changed (same as issue #121 )
Step 7/12 : RUN unzip -d / jvm/target/universal/kaitai-struct-compiler-0.9-SNAPSHOT.zip
 ---> Running in b74c7540079c
unzip:  cannot find or open jvm/target/universal/kaitai-struct-compiler-0.9-SNAPSHOT.zip, jvm/target/universal/kaitai-struct-compiler-0.9-SNAPSHOT.zip.zip or jvm/target/universal/kaitai-struct-compiler-0.9-SNAPSHOT.zip.ZIP.
The command '/bin/sh -c unzip -d / jvm/target/universal/kaitai-struct-compiler-0.9-SNAPSHOT.zip' returned a non-zero code: 9
make: *** [Makefile:12: docker-kaitai] Error 9
  1. src/Makefile assumes that kaitai-struct-compiler is in PATH but it is not
Step 5/16 : RUN make
 ---> Running in b21cb46187e5
kaitai-struct-compiler  -t python --outdir `dirname "parsers/font/pcf/pcf_font.ksy"` parsers/font/pcf/pcf_font.ksy
/bin/sh: 1: kaitai-struct-compiler: not found
Makefile:25: recipe for target 'parsers/font/pcf/pcf_font.py' failed
make: *** [parsers/font/pcf/pcf_font.py] Error 127
The command '/bin/sh -c make' returned a non-zero code: 2
  1. src/Dockerfile assumes that bangshell is in the PATH which it is not python3: can't open file '/kaitai_struct/runtime/python/bangshell': [Errno 2] No such file or directory

I'm going to create a pull request that fixes these issues.

Besides that I think the following things could be changed:

  1. It's a little confusing that the makefile target is called "docker-kaitai" but the default value for "CTR_BUILDER" is not docker. Maybe podman and docker should just have different makefile targets instead of being dependent on the "CTR_BUILDER" variable.
  2. It's not clear how to invoke bang-scanner from the docker image.

seihtam avatar May 06 '21 12:05 seihtam

Thanks for the report. Currently we are refactoring the code a lot, so it might take some time before we get to this.

armijnhemel avatar May 06 '21 12:05 armijnhemel