3 ms·
I deploy Docker images on a lot of small devices with sketchy internet connections. During development, it really does matter if my images are 4MB or 80MB. Ju
by sshine 3y ago
I deploy Docker images on a lot of small devices with sketchy internet connections.
During development, it really does matter if my images are 4MB or 80MB.
Just like when compilation times and tests start growing in the minutes, my feedback cycle is broken.
I also compile Rust statically to musl, so I'll seriously consider building the final image on the device to avoid copying the base image during deployment. Or ditch Docker entirely.
- Xelynega 3y agoIsn't their point that docker brought incrementalness to this? So just like when you change one c file you don't have to recompile the whole project, updating the last layer in the image should only require a few mb of transfer, the base layers would only be transfered once.
- returningfory2 3y agoMy initial suspension is that this falls into the "In most cases it's not even an optimization" case, but do correct me if I'm wrong. When you create a new Docker image with a recompiled Rust binary, only the last Docker layer will need to be downloaded to the device. Incremental caching means Docker won't re-download the base layer. The last layer is basically the new binary itself. So I don't see how it would be slower than copying the raw binary. But maybe I'm missing something.