softprops / shiplift

🐳 🦀 rust interface for maneuvering docker containers
MIT License
624 stars 119 forks source link

Speed up `build` command #289

Open cswinter opened 3 years ago

cswinter commented 3 years ago

The imagebuild example is much slower than the docker cli. For a relatively small build (docker cli reports 25.15MB of build context) which is fully cached, the docker cli takes around 0.27 seconds and imagebuild.rs takes 0m1.352s. I haven't profiled it, but output takes much longer to appear for imagebuild.rs and my suspicion is that the tarball operation might be the cause: https://github.com/softprops/shiplift/blob/9750d29614776e1372ef8b6580e0ae0eedc6801f/src/image.rs#L124