Skip to content

Conversation

vxcall
Copy link
Contributor

@vxcall vxcall commented Jul 31, 2024

Hi, I found that docker build takes really long with current Dockerfile and I thought I can help u with it.

This PR significantly decreases build time. More specifically, when u change source files, because it's nothing to do with dependency list, u can completely skip dependency install step which is huge.

so I made following changes:

  • execute all dependency install first. because COPY all the source code before dependency install typically makes docker confuse and end up not caching.
  • added --mount=type=cache to utilize cache type mount which persists between build layers.
  • changed ENTRYPOINT from /bin/bash to /root/Mergen/build/lifter so that u can directly do docker run -it --rm mergen FILEPATH ADDRESS. Cuz I didnt see the benefit of going into bash. If there's any benefit of run bash than directly lifter bin, tell me

speed in action in my env

These are the build logs for

  • subtle .cpp file change
  • dependency change

When I make small change to cpp files it took 2.6 seconds to build. became way faster
image

When I add curl to dependency list, it takes 366 seconds to build which is ok cuz it's dependency build. maybe i can make it faster tho but it's out of scope for now.
image

Also since i changed the entrypoint, u have to mount the directory into container like this docker run --rm -v /Users/vxcall/Downloads:/root/Mergen/data mergen /root/Mergen/data/devirtualizeme.exe 0xADDRESS

@vxcall
Copy link
Contributor Author

vxcall commented Jul 31, 2024

Also I'm passionate about learning vmp lifting by messing around this repo, so could you put good first issue tag on easy one so that I can work on it from there?

Copy link
Owner

@NaC-L NaC-L left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for your contribution.

@NaC-L NaC-L merged commit 8b53aff into NaC-L:main Aug 1, 2024
@NaC-L
Copy link
Owner

NaC-L commented Aug 1, 2024

I will try to organize issues o7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants