Uploaded image for project: 'Infrastructure'
  1. Infrastructure
  2. INFRA-2578

Builds starting a docker linux image fails in both linux and windows agents because different reasons

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I'm trying to build a silly change on ldap-plugin:
      https://github.com/jenkinsci/ldap-plugin/pull/42

      There are some tests which build an image and start a docker container. When running on linux agents, the failure is:

      === Starting userLookup(hudson.security.docker.MultiServerTest)
      Building Docker image `docker build -t jenkins/openldap-express:9b56839e8aef /home/jenkins/workspace/Plugins_ldap-plugin_PR-42/target/tmp/Dockerfile7397079922283907774dir`: logfile is at /home/jenkins/workspace/Plugins_ldap-plugin_PR-42/target/tmp/docker-PlanetExpress-build4406155771672321143.log
      Launching Docker container `docker run -d -p 127.0.0.1::389 -p 127.0.0.1::636 jenkins/openldap-express:9b56839e8aef`: logfile will be at /home/jenkins/workspace/Plugins_ldap-plugin_PR-42/target/tmp/docker-PlanetExpress-run2263005689478875603.log
      ---%<--- docker-PlanetExpress-run2263005689478875603.log
      starting slapd on port 389 and 636...
      5e982e84 @(#) $OpenLDAP: slapd  (Aug 10 2019 19:17:00) $
      	Debian OpenLDAP Maintainers <pkg-openldap-devel@lists.alioth.debian.org>
      5e982e85 ch_calloc of 1048576 elems of 704 bytes failed
      slapd: ../../../../servers/slapd/ch_malloc.c:107: ch_calloc: Assertion `0' failed.
      --->%---
      

      When running on Windows agents, the failure is:

      === Starting userLookup(hudson.security.docker.MultiServerTest)
      Building Docker image `docker build -t jenkins/openldap-express:9b56839e8aef C:\Jenkins\workspace\Plugins_ldap-plugin_PR-42\target\tmp\Dockerfile9013937474209655715dir`: logfile is at C:\Jenkins\workspace\Plugins_ldap-plugin_PR-42\target\tmp\docker-PlanetExpress-build8065047235520224636.log
      ---%<--- docker-PlanetExpress-build8065047235520224636.log
      Sending build context to Docker daemon  2.048kB
      Step 1/1 : FROM rroemhild/test-openldap:latest
      latest: Pulling from rroemhild/test-openldap
      image operating system "linux" cannot be used on this platform
      --->%---
      

      The tests run successfully on my machine and these tests have been there for a long time.

        Attachments

          Activity

          Hide
          mramonleon Ramon Leon added a comment - - edited

          The latest build for a ldap plugin PR now just returns the failure about docker images on Windows builds:

          === Starting userLookup(hudson.security.docker.MultiServerTest)
          Building Docker image `docker build -t jenkins/openldap-express:9b56839e8aef C:\Jenkins\workspace\Plugins_ldap-plugin_PR-43\target\tmp\Dockerfile1874174702520077564dir`: logfile is at C:\Jenkins\workspace\Plugins_ldap-plugin_PR-43\target\tmp\docker-PlanetExpress-build2147516411174234036.log
          ---%<--- docker-PlanetExpress-build2147516411174234036.log
          Sending build context to Docker daemon  2.048kB
          Step 1/1 : FROM rroemhild/test-openldap:latest
          latest: Pulling from rroemhild/test-openldap
          image operating system "linux" cannot be used on this platform
          --->%---
          

          The build failure is because docker linux images are not allowed on windows builds:

          https://docs.docker.com/docker-for-windows/#switch-between-windows-and-linux-containers

          > From the Docker Desktop menu, you can toggle which daemon (Linux or Windows) the Docker CLI talks to. Select Switch to Windows containers to use Windows containers, or select Switch to Linux containers to use Linux containers (the default).

          Show
          mramonleon Ramon Leon added a comment - - edited The latest build for a ldap plugin PR now just returns the failure about docker images on Windows builds: PR: https://github.com/jenkinsci/ldap-plugin/pull/43 Log: https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fldap-plugin/detail/PR-43/2/tests === Starting userLookup(hudson.security.docker.MultiServerTest) Building Docker image `docker build -t jenkins/openldap-express:9b56839e8aef C:\Jenkins\workspace\Plugins_ldap-plugin_PR-43\target\tmp\Dockerfile1874174702520077564dir`: logfile is at C:\Jenkins\workspace\Plugins_ldap-plugin_PR-43\target\tmp\docker-PlanetExpress-build2147516411174234036.log ---%<--- docker-PlanetExpress-build2147516411174234036.log Sending build context to Docker daemon 2.048kB Step 1/1 : FROM rroemhild/test-openldap:latest latest: Pulling from rroemhild/test-openldap image operating system "linux" cannot be used on this platform --->%--- The build failure is because docker linux images are not allowed on windows builds: https://docs.docker.com/docker-for-windows/#switch-between-windows-and-linux-containers > From the Docker Desktop menu, you can toggle which daemon (Linux or Windows) the Docker CLI talks to. Select Switch to Windows containers to use Windows containers, or select Switch to Linux containers to use Linux containers (the default).

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            mramonleon Ramon Leon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: