Skip to content

Use nproc command to automatically scale to number of cores#157

Open
olivier-thatch wants to merge 1 commit intofly-apps:mainfrom
olivier-thatch:nproc-auto
Open

Use nproc command to automatically scale to number of cores#157
olivier-thatch wants to merge 1 commit intofly-apps:mainfrom
olivier-thatch:nproc-auto

Conversation

@olivier-thatch
Copy link
Contributor

This PR changes the nproc option to be a boolean instead of a numeric. When the nproc option is set to true, the following line is added to the Dockerfile:

ENV MAKE="make -j$(nproc)"

which will cause the make command to automatically scale based on the number of CPU cores returned by the nproc command. nproc is part of GNU Core Utilities and should always be available.

This is a fairly common approach, e.g. https://github.com/search?q=path%3ADockerfile+%22ENV+MAKE%3D%5C%22make+-j%24%28nproc%29%5C%22%22&type=code

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.

1 participant