Prefer dynamically-linked binaries for Debian Docker images #588
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR replaces statically-linked binaries (musl) with dynamically-linked binaries (libc) for Debian Docker images to improve containers' performance and resource utilisation.
Resource optimization
At startup, a SWS Docker container (
linux/amd64) using a statically-linked binary requires~31MiBof RAM:docker run -it --rm --name sws -p 8787:80 -v $PWD/docker/public:/public joseluisq/static-web-server:2-debian $ docker stats sws CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS 6cb1ab2a8394 sws 0.00% 31.52MiB / 7.617GiB 0.40% 6.78kB / 126B 7.16MB / 0B 5However, its dynamically-linked counterpart will require
~1.5MiBof RAM:Affected targets
linux/amd64updated tox86_64-unknown-linux-gnulinux/arm64updated toaarch64-unknown-linux-gnulinux/386updated toi686-unknown-linux-gnulinux/arm/v6updated toarm-unknown-linux-gnueabihfNote affected yet
linux/arm/v7still usesarmv7-unknown-linux-musleabihf(statically-linked), but it will be updated toarmv7-unknown-linux-gnueabihfonce a binary is available (postv2.40.0).Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):