ThreatMapper icon indicating copy to clipboard operation
ThreatMapper copied to clipboard

Optimize the deepfence_agent container build

Open vadorovsky opened this issue 3 years ago • 0 comments

Currently building the deepfence_agent container image takes at least 15 minutes, regardless of how small the change is and which component or plugin was modified. That's because building the most of binaries happens in build.sh with docker run commands, like:

https://github.com/deepfence/ThreatMapper/blob/d00b722d5957f6f7a3c61294418be16b756cdcc7/deepfence_agent/build.sh#L18-L24

By doing that this way, we cannot cache any build results and builds are performed every time from scratch.

The solution for that problem is using Docker buildx multi-stage builds which will allow us to cache build artifacts for each dependency.

vadorovsky avatar May 25 '22 15:05 vadorovsky