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.

          Form Name

            [BCLOUD-16185] Maven container fails to detect CPU cores

              Unassigned Unassigned
              39e5e856068a borisredkin
              Affected customers:
              0 This affects my team
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: