在Jenkins中的Docker容器中编译Android项目

时间:2019-03-06 19:51:24

标签: android docker ubuntu jenkins gradle

我想使用Docker在Jenkins中使用Gradle编译Android项目,并且在构建项目时收到以下消息:

Docker container 9a2b37cfcc86552c0b6635537afd897dbc7639b25394b5f272f402b7d83ed540 started to host the build
[Gradle] - Launching build.
$ docker -H tcp://192.168.0.234:2375 exec --tty 9a2b37cfcc86552c0b6635537afd897dbc7639b25394b5f272f402b7d83ed540 env
Error response from daemon: Container 9a2b37cfcc86552c0b6635537afd897dbc7639b25394b5f272f402b7d83ed540 is not running
ERROR: Build step failed with exception
java.lang.RuntimeException: Failed to retrieve container's environment
    at com.cloudbees.jenkins.plugins.docker_build_env.Docker.getEnv(Docker.java:321)
    at com.cloudbees.jenkins.plugins.docker_build_env.DockerDecoratedLauncher.buildContainerEnvironment(DockerDecoratedLauncher.java:59)
    at com.cloudbees.jenkins.plugins.docker_build_env.DockerDecoratedLauncher.launch(DockerDecoratedLauncher.java:47)
    at hudson.Launcher$ProcStarter.start(Launcher.java:455)
    at hudson.Launcher$ProcStarter.join(Launcher.java:466)
    at hudson.plugins.gradle.Gradle.performTask(Gradle.java:332)
    at hudson.plugins.gradle.Gradle.perform(Gradle.java:224)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
    at hudson.model.Build$BuildExecution.build(Build.java:206)
    at hudson.model.Build$BuildExecution.doRun(Build.java:163)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
    at hudson.model.Run.execute(Run.java:1810)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Build step 'Invoke Gradle script' marked build as failure
Stopping Docker container after build completion

我尝试了runmymind/docker-android-sdkthyrlian/android-sdk之类的不同Dockerfile-相同的错误。

主机的操作系统为Ubuntu 18 aarch64。

Jenkins职位设置:

Docker Plugin

Gralde Plugin Environment Variables

0 个答案:

没有答案