Summary

      Unable to "Build Docker image" from Docker task

      Resolution

      Problem is fixed in Bamboo 5.13.0.1. In case you can't upgrade please download bamboo-docker-plugin 5.10.3 from https://bitbucket.org/atlassian/bamboo-docker-plugin/downloads and install it in Bamboo via Administration / Manage addons

      Steps to Reproduce

      1. Install Docker
      2. Set the docker capability on Bamboo
      3. Create a plan and add the docker task to it
      4. Set the docker task configuration as the following:
      5. Run the build

      Expected Results

      The new image is built and added to the image repository.

      Actual Results

      When running Bamboo's Docker task, the following error gets thrown.

      build log
      error	04-Jul-2016 19:35:54	invalid argument "\"ubuntu:latest\"" for --tag="ubuntu:latest": Error parsing reference: "\"ubuntu:latest\"" is not a valid repository/tag
      error	04-Jul-2016 19:35:54	See 'docker build --help'.
      simple	04-Jul-2016 19:35:54	Failing task since return code of [/usr/local/bin/docker build --force-rm=true --tag="ubuntu:latest" /opt/atlassian/home/atlassian-bamboo-5.12.2.1/xml-data/build-dir/PROJ-DOC-JOB1] was 1 while expected 0
      error	04-Jul-2016 19:35:54	Error occurred while running Task '(1)' of type com.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli.
      error	04-Jul-2016 19:35:54	com.atlassian.bamboo.task.TaskException: Failed to execute task
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.plugins.docker.service.BuildService.execute(BuildService.java:53)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.plugins.docker.tasks.cli.DockerCliTask.execute(DockerCliTask.java:60)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$272(TaskExecutorImpl.java:317)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:246)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:317)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:118)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:74)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:215)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:139)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:130)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:221)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:129)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:137)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:51)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
      error	04-Jul-2016 19:35:54		at java.lang.Thread.run(Thread.java:745)
      error	04-Jul-2016 19:35:54	Caused by: com.atlassian.bamboo.plugins.docker.client.DockerException: Error running Docker build command
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.plugins.docker.client.DockerCmd.build(DockerCmd.java:189)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.plugins.docker.service.BuildService.execute(BuildService.java:40)
      error	04-Jul-2016 19:35:54		... 17 more
      error	04-Jul-2016 19:35:54	Caused by: com.atlassian.utils.process.ProcessException: Error executing /usr/local/bin/docker build --force-rm=true --tag="ubuntu:latest" /opt/atlassian/home/atlassian-bamboo-5.12.2.1/xml-data/build-dir/PROJ-DOC-JOB1
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.plugins.docker.process.DockerTaskProcessService.execute(DockerTaskProcessService.java:60)
      error	04-Jul-2016 19:35:54		at com.atlassian.bamboo.plugins.docker.client.DockerCmd.build(DockerCmd.java:185)
      error	04-Jul-2016 19:35:54		... 18 more
      

      Running the same command from Terminal works successfully:

      /usr/local/bin/docker build --force-rm=true --tag="ubuntu:latest" /opt/atlassian/home/atlassian-bamboo-5.12.2.1/xml-data/build-dir/PROJ-DOC-JOB1
      

      Notes

      $ docker images
      REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
      ubuntu              latest              0f192147631d        5 days ago          132.8 MB
      

      Workaround

      1. Some customers have reported that downgrading Docker to 1.11 corrected the issue for them.
      2. Avoid using the Docker task and use the script task instead.

            [BAM-17729] Unable to "Build Docker image" from Docker task

            singh.exam, to answer your question it's required to check Bamboo instance logs. Please create request at support.atlassian.com to allow our support engineers help you

            Alexey Chystoprudov added a comment - singh.exam , to answer your question it's required to check Bamboo instance logs. Please create request at support.atlassian.com to allow our support engineers help you

            Failed to enable add-on Bamboo Docker Support (com.atlassian.bamboo.plugins.bamboo-docker-plugin

             

            How do i resolve the timeout problem in bamboo. 

             

            Vishvendra Chauhan added a comment - Failed to enable add-on Bamboo Docker Support (com.atlassian.bamboo.plugins.bamboo-docker-plugin   How do i resolve the timeout problem in bamboo.   

            Alexey Chystoprudov added a comment - anjandudda259754667 , removed.

            anjan dv added a comment -

            Hi,

            I am extremely sorry to upload a DockerFile. I am facing docker build issue with bamboo. Please remove the DockerFile.

            Regards,

            Anjan

            anjan dv added a comment - Hi, I am extremely sorry to upload a DockerFile. I am facing docker build issue with bamboo. Please remove the DockerFile. Regards, Anjan

            Problem is fixed in Bamboo 5.13.0.1. In case you can't upgrade please download bamboo-docker-plugin 5.10.3 from https://bitbucket.org/atlassian/bamboo-docker-plugin/downloads and install it in Bamboo via Administration / Manage addons

            Krystian Brazulewicz added a comment - Problem is fixed in Bamboo 5.13.0.1. In case you can't upgrade please download bamboo-docker-plugin 5.10.3 from https://bitbucket.org/atlassian/bamboo-docker-plugin/downloads and install it in Bamboo via Administration / Manage addons

            Hi,

            Atlassian Bamboo version 5.12.3.1 build 51215 has the same problem.

            Regards,
            Dévald

            Dévald TARI added a comment - Hi, Atlassian Bamboo version 5.12.3.1 build 51215 has the same problem. Regards, Dévald

            I forgot to mention that we have this issue on Linux, Ubuntu 16.04.

            csaba.sari@shore.com added a comment - I forgot to mention that we have this issue on Linux, Ubuntu 16.04.

            Hi,

            we have the same error, but I don't think so that this is a Minor bug. Docker version downgrade solves the issue, but without version 1.12 we don't have the swarm functionality.

            Please raise the priority higher like High.

            regards,
            Csaba

            csaba.sari@shore.com added a comment - Hi, we have the same error, but I don't think so that this is a Minor bug. Docker version downgrade solves the issue, but without version 1.12 we don't have the swarm functionality. Please raise the priority higher like High. regards, Csaba

              moles Marcin Oles
              dsantos Daniel Santos (Inactive)
              Affected customers:
              9 This affects my team
              Watchers:
              19 Start watching this issue

                Created:
                Updated:
                Resolved: