Maven container fails to detect CPU cores

XMLWordPrintable

      When building a Maven project with pipelines in maven:3-jdk-11-slim container it fails to detect number of CPU cores.

      The number of processors were checked with a pipeline step

      grep -c ^processor /proc/cpuinfo
      8
      

      But running

      #!java
      
      public class ThreadUtils {
        public static void main(String[] args) {
          System.out.println("Number of available processors: " + Runtime.getRuntime().availableProcessors());
        }
      }
      

      produces a wrong result:

      Number of available processors: 1
      

      Running ThreadUtils on a local machine with the same docker image maven:3-jdk-11-slim produces the expected result of correct number of CPU cores.

            Assignee:
            Unassigned
            Reporter:
            borisredkin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: