Uploaded image for project: 'Bamboo'
  1. Bamboo
  2. BAM-19827

Docker Runner build will fail if the image used specifies a non-root user for the USER in the Dockerfile

    XMLWordPrintable

    Details

      Description

      Summary

      Docker runner build will fail if the image used specifies a non-root user for the USER in the Dockerfile

      Environment

      Docker version 17.12.0-ce, build c97c6d6
      

      Steps to Reproduce

      1. Run a docker runner job using the image: instructure/core:latest

      Expected Results

      Build succeeds.

      Actual Results

      The below error is thrown in the build log:

      command	11-Apr-2018 14:31:49	Beginning to execute external process for build 'PROJ - PLAN - JOB #43 (PROJ-PLAN-JOB1-43)'\n ... running command line: \n/usr/bin/docker exec b54d80ca-e543-4e16-b0e2-613d8a8eb501 /tmp/intialiseContainer.sh\n ... in: /var/bamboo-home-new/xml-data/build-dir/92963244/PROJ-PLAN-JOB1\n
      error	11-Apr-2018 14:31:49	/bin/sh: 0: Can't open /tmp/intialiseContainer.sh
      error	11-Apr-2018 14:31:49	Failed to start docker container b54d80ca-e543-4e16-b0e2-613d8a8eb501
      error	11-Apr-2018 14:31:49	com.atlassian.bamboo.docker.DockerException: Error running Docker run command
      error	11-Apr-2018 14:31:49		at com.atlassian.bamboo.docker.DockerContainerServiceImpl.run(DockerContainerServiceImpl.java:118)
      error	11-Apr-2018 14:31:49		at com.atlassian.bamboo.v2.build.agent.docker.DockerContainerControllerImpl.startContainerIfRequired(DockerContainerControllerImpl.java:78)
      error	11-Apr-2018 14:31:49		at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:173)
      error	11-Apr-2018 14:31:49		at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.lambda$waitAndPerformBuild$0(BuildAgentControllerImpl.java:122)
      error	11-Apr-2018 14:31:49		at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:185)
      error	11-Apr-2018 14:31:49		at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:117)
      error	11-Apr-2018 14:31:49		at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:126)
      error	11-Apr-2018 14:31:49		at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)
      error	11-Apr-2018 14:31:49		at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
      error	11-Apr-2018 14:31:49		at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
      error	11-Apr-2018 14:31:49		at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)
      error	11-Apr-2018 14:31:49		at java.lang.Thread.run(Thread.java:748)
      error	11-Apr-2018 14:31:49	Caused by: com.atlassian.utils.process.ProcessException: Error executing /usr/bin/docker exec b54d80ca-e543-4e16-b0e2-613d8a8eb501 /tmp/intialiseContainer.sh
      error	11-Apr-2018 14:31:49		at com.atlassian.bamboo.docker.DockerContainerServiceImpl.execute(DockerContainerServiceImpl.java:252)
      error	11-Apr-2018 14:31:49		at com.atlassian.bamboo.docker.DockerContainerServiceImpl.run(DockerContainerServiceImpl.java:115)
      error	11-Apr-2018 14:31:49		... 11 more
      

      Workaround

      • None, need to use an image that where docker exec commands are performed as root.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pskierczynski Pawel Skierczynski
              Reporter:
              jowen@atlassian.com Jeremy Owen
              Votes:
              7 Vote for this issue
              Watchers:
              16 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: