Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 如何通过Jenkins容器从docker hub提取图像_Image_Docker_Jenkins_Containers - Fatal编程技术网

Image 如何通过Jenkins容器从docker hub提取图像

Image 如何通过Jenkins容器从docker hub提取图像,image,docker,jenkins,containers,Image,Docker,Jenkins,Containers,我在docker中构建了一个Jenkins容器,我想从Jenkins作业中的docker hub中构建一个容器(例如:ubuntu),但是失败了,控制台输出显示从docker图像中提取失败ubuntu:latest,这里有什么问题 请帮帮我,谢谢 以下是控制台输出: Running as SYSTEM Building in workspace /var/jenkins_home/workspace/pull_docker_image Pull Docker image ubuntu:lates

我在docker中构建了一个Jenkins容器,我想从Jenkins作业中的docker hub中构建一个容器(例如:ubuntu),但是失败了,控制台输出显示从docker图像中提取失败
ubuntu:latest
,这里有什么问题

请帮帮我,谢谢

以下是控制台输出:

Running as SYSTEM
Building in workspace /var/jenkins_home/workspace/pull_docker_image
Pull Docker image ubuntu:latest from repository ...
$ /var/jenkins_home/tools/org.jenkinsci.plugins.docker.commons.tools.DockerTool/docker/bin/docker pull ubuntu:latest
Failed to pull Docker image ubuntu:latest
--------------------------------------------------------
FATAL: Failed to pull Docker image ubuntu:latest
------------------------------------------------------------------
java.io.IOException: Failed to pull Docker image ubuntu:latest
    at com.cloudbees.jenkins.plugins.docker_build_env.PullDockerImageSelector.prepareDockerImage(PullDockerImageSelector.java:34)
    at com.cloudbees.jenkins.plugins.docker_build_env.DockerBuildWrapper.setUp(DockerBuildWrapper.java:179)
    at hudson.model.Build$BuildExecution.doRun(Build.java:157)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
    at hudson.model.Run.execute(Run.java:1815)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE
以下是我的配置:

运行包含jenkins的容器时,您是否将其docker.sock绑定到一个托管操作系统,以便从jenkins容器运行docker命令

docker run -it -v /var/run/docker.sock:/var/run/docker.sock JENKINS_IMAGE
如果这是问题的解决方案,您可能还需要使用正确的权限访问/var/run/docker.sock


让我知道。

您使用哪种jenkins插件进行此操作?@BimalVasan我使用此“CloudBees Docker自定义构建环境插件”