首页 > 解决方案 > 如何修复“错误:docker 版本低于 v1.7。需要“docker exec”的管道函数

问题描述

我尝试通过Jenkins管道在docker容器下做一些事情,我的jenkinsfile如下:

pipeline {
  agent { docker 'node:6.3' }
     stages {
         stage('test') {                                                                                                               
             steps {
                 npm version
             }
         }
     }
}

我的码头工人版本:

$docker version 
Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.2.1
Git commit (client): 7c8fca2
OS/Arch (client): linux/amd64
Server version: 1.6.2
Server API version: 1.18
Go version (server): go1.2.1
Git commit (server): 7c8fca2
OS/Arch (server): linux/amd64
Is there anyone has some suggestions.

然后,我收到错误消息:

[Bitbucket] Notifying commit build result
[Bitbucket] Build result notified
ERROR: The docker version is less than v1.7. Pipeline functions 
requiring 'docker exec' (e.g. 'docker.inside') or SELinux labeling will not work.
Finished: FAILURE

有没有人有一些建议?谢谢~

标签: dockerjenkins-pipeline

解决方案


升级 docker CE 后,此问题已解决。


推荐阅读