Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-16185

Maven container fails to detect CPU cores

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            39e5e856068a borisredkin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: