Bamboo docker 构建失败?

Bamboo docker build failing?

我有一个 docker 容器:

/usr/bin/docker run --volume /home/bamboo/builds/xml-data/build-dir/360449/WEBSITE-BD-JOB3:/home/bamboo/builds/xml-data/build-dir/360449/WEBSITE-BD-JOB3 --volume /var/atlassian/application-data/bamboo/temp:/var/atlassian/application-data/bamboo/temp --detach --name 511d9b8d-cd36-4d53-92c9-78a94c2be6795570564 --net=host shamilnunhuck/kaniko-debug:shell tail -f /dev/null

我假设 Bamboo 正在尝试复制我的脚本?

/usr/bin/docker cp /opt/atlassian/bamboo/temp/initialiseDockerContainer.sh7168219084128755568.tmp 511d9b8d-cd36-4d53-92c9-78a94c2be6795570564:/tmp/initialiseContainer.sh

然而,它失败了:

Error: No such container:path: 511d9b8d-cd36-4d53-92c9-78a94c2be6795570564:/tmp
Exit code: 1, output: STDOUT:  Beginning to execute external process for build 'Shamil Website - Build - Publish Image #25 (WEBSITE-BD-JOB3-25)'\n ... running command line: \n/usr/bin/docker cp /opt/atlassian/bamboo/temp/initialiseDockerContainer.sh7168219084128755568.tmp 511d9b8d-cd36-4d53-92c9-78a94c2be6795570564:/tmp/initialiseContainer.sh\n ... in: /home/bamboo/builds/xml-data/build-dir/360449/WEBSITE-BD-JOB3\nSTDERR: Error: No such container:path: 511d9b8d-cd36-4d53-92c9-78a94c2be6795570564:/tmp
Failed to start docker container 511d9b8d-cd36-4d53-92c9-78a94c2be6795570564
com.atlassian.bamboo.docker.DockerException: Error running Docker run command
        at com.atlassian.bamboo.docker.DockerContainerServiceImpl.run(DockerContainerServiceImpl.java:130)
        at com.atlassian.bamboo.v2.build.agent.docker.DockerContainerControllerImpl.startContainerIfRequired(DockerContainerControllerImpl.java:98)
        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:154)
        at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.lambda$waitAndPerformBuild[=13=](BuildAgentControllerImpl.java:130)
        at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:118)
        at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:124)
        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.lambda$start[=13=](DefaultBuildAgent.java:108)
        at com.atlassian.bamboo.utils.BambooRunnables.run(BambooRunnables.java:48)
        at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
        at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
        at com.atlassian.bamboo.security.ImpersonationHelper.run(ImpersonationHelper.java:41)
        at java.lang.Thread.run(Thread.java:748)
Caused by: com.atlassian.utils.process.ProcessException: Error executing /usr/bin/docker cp /opt/atlassian/bamboo/temp/initialiseDockerContainer.sh7168219084128755568.tmp 511d9b8d-cd36-4d53-92c9-78a94c2be6795570564:/tmp/initialiseContainer.sh
        at com.atlassian.bamboo.docker.DockerContainerServiceImpl.execute(DockerContainerServiceImpl.java:302)
        at com.atlassian.bamboo.docker.DockerContainerServiceImpl.execute(DockerContainerServiceImpl.java:273)
        at com.atlassian.bamboo.docker.DockerContainerServiceImpl.run(DockerContainerServiceImpl.java:112)
        ... 11 more

Bamboo 可以删除容器,所以我假设它仍然是 运行。知道为什么会失败吗?

竹规格:

Publish Image:
  tasks:
    - artifact-download:
        source-plan: WEBSITE-BD
        artifacts:
          - name: release
    - script:
      - echo "{\"auths\":{\"r.gcr.io\":{\"username\":\"kubernetes\",\"password\":\"${bamboo.CI_REGISTRY_PASSWORD}\"}}}" > /kaniko/.docker/config.json
      - /kaniko/executor
        --cache=true \
        --context . \
        --dockerfile ./release/Dockerfile \
        --destination r.gcr.io/hadcm3/personal-website:${bamboo.planRepository.revision}
  docker:
    image: shamilnunhuck/kaniko-debug:shell

命令

/usr/bin/docker cp \
    /opt/atlassian/bamboo/temp/initialiseDockerContainer.sh7168219084128755568.tmp \
    511d9b8d-cd36-4d53-92c9-78a94c2be6795570564:/tmp/initialiseContainer.sh

表示它试图将您的脚本复制到容器中。错误

No such container:path: 511d9b8d-cd36-4d53-92c9-78a94c2be6795570564:/tmp

肯定是由 docker 而不是 Bamboo 发出的。所以在我看来:

  • 容器中不存在/tmp
  • 或者容器没有启动(立即失败)