Cannot connect to the Docker daemon. Is the docker daemon running on this host?

  在配置Jenkins从Gitlab自动构建Dockerfile上传至Harbor时遇到了上述问题,jenkins中执行docker命令会有上述报错,查阅相关资料后发现解决办法如下:

一、修改Docker服务配置

systemctl stop docker

sudo gpasswd -a jenkins docker#将jenkins用户加入docker组

vim /usr/lib/systemd/system/docker.service

#ExecStart=/usr/bin/dockerd-current \
# --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \
# --default-runtime=docker-runc \
# --exec-opt native.cgroupdriver=systemd \
# --userland-proxy-path=/usr/libexec/docker/docker-proxy-current \
# $OPTIONS \
# $DOCKER_STORAGE_OPTIONS \
# $DOCKER_NETWORK_OPTIONS \
# $ADD_REGISTRY \
# $BLOCK_REGISTRY \
# $INSECURE_REGISTRY\
# $REGISTRIES
ExecStart=/usr/bin/docker daemon -H unix:// -H tcp://192.168.1.1:2375
#将以上注释的配置文件替换为下面新加的文件。

systemctl daemon-reload

systemctl restart docker

二、重启Jenkins服务,构建当前项目查看是否可以执行docker相关命令

systemctl restart jenkins

  如果遇到过滤Jenkins进程显示当前服务已经关闭,但是Jenkins仍无法启动的问题可以执行java -jar jenkins.war命令来看详细报错,比较奇葩的是我已经将jenkins进程关闭了,过滤服务以及端口都已经显示关闭了,但是启动jenkins服务时还是会报地址被占用的错误,此时再重新执行systemctl stop jenkins命令,然后对jenkins服务进行启动,看看是否可以解决。

Jenkins中执行docker命令报错的更多相关文章

  1. 执行Docker命令报错解决办法

    shim error: docker-runc not installed on system   服务器重启以后,执行docker命令报以上错误,解决办法如下: cd /usr/libexec/do ...

  2. hbase shell中执行list命令报错:ERROR: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing

    问题描述: 今天在测试环境中,搭建hbase环境,执行list命令之后,报错: hbase(main):001:0> list TABLE ERROR: org.apache.hadoop.hb ...

  3. RedHat中敲sh-copy-id命令报错:-bash: ssh-copy-id: command not found

    RedHat中敲sh-copy-id命令报错:-bash: ssh-copy-id: command not found 在多台Linux服务器SSH相互访问无需密码, 其中进入一台Linus中,对其 ...

  4. Python3安装Celery模块后执行Celery命令报错

    1 Python3安装Celery模块后执行Celery命令报错 pip3 install celery # 安装正常,但是执行celery 命令的时候提示没有_ssl模块什么的 手动在Python解 ...

  5. 在Jenkins中执行 PowerShell 命令实现高效的CD/CI部署

    相比于cmd,powershell支持插件.语法扩展和自定义扩展名,是智能化部署中闪闪的新星,越来越多的开发者偏爱使用Powershell. 如何让Jenkins支持Powershell呢?本文即展开 ...

  6. 安装atlas后执行hive命令报错

    在集群中安装atlas,在安装atlas的节点上执行hive -e "show databases;" 正常,但是在集群中其他节点上执行hive -e "show dat ...

  7. 执行 maven 命令 报错Unable to add module to the current project as it is not of packaging type 'pom'[转]

    今天学习在本地搭建Maven工程时,执行了mvn archetype:generate 命令,报错. Unable to create project from archetype [org.apac ...

  8. 关于ubuntu上执行错误命令报错

    Sorry, command-not-found has crashed! 新安装了一台ubuntu server 安装时用中文安装的,之后命令行下各种乱码,最后也不知道是修改哪里造成的 每次执行一次 ...

  9. Mac 升级后idea执行git命令报错xcrun: error: invalid active developer path的解决办法

    报错 xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun ...

随机推荐

  1. 清理数据库errorlog

    C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOGERRORLOGERRORLOG.1ERRORLOG.2ERRORLOG.3ERRORLO ...

  2. JSP页面与JSP页面之间传输参数出现中文乱码的解决方案

    在学习编程初期JSP与JSP页面之间传输参数大多数都是使用这样的方式 index.jsp?id=*&name=* 这样的传输方式实质上是一种GET传输方式, 那如果出现了中文乱码, 解决方法其 ...

  3. byte,short,int,long数据之间的倍数关系

    基本数据类型 byte   =  -128和127------------------------------------------------------------2的8次方,1个字节 shor ...

  4. mybatis什么时候需要声明jdbcType?

    经常会见到以下两种写法:1. #{bookId}2. #{bookId,jdbcType=INTEGER}一般情况下,两种写法都可以.它们都可以获取Dao层传递过来的参数.但是,当传入的参数为null ...

  5. keras—多层感知器MLP—MNIST手写数字识别

    一.手写数字识别 现在就来说说如何使用神经网络实现手写数字识别. 在这里我使用mind manager工具绘制了要实现手写数字识别需要的模块以及模块的功能:  其中隐含层节点数量(即神经细胞数量)计算 ...

  6. Oracle的下载、安装和配置

    win10下Oracle的下载.安装和配置     --------------siwuxie095                 1.首先到Oracle官网下载Oracle,中文版官网,传送阵:点 ...

  7. 【c++】多层次继承类对象的构造函数参数的传递方法

    #include <iostream.h> //基类CBase class CBase { int a; public: CBase(int na) { a=na; cout<< ...

  8. [z]kafka相关资料

    http://my.oschina.net/ielts0909/blog/93190 http://www.iteye.com/magazines/107 http://blog.csdn.net/h ...

  9. [freeCodeCamp] solution to JUGGLING ASYNC

    Here's the official solution in case you want to compare notes: var http = require('http') var bl = ...

  10. Flask源码剖析详解

    1. 前言 本文将基于flask 0.1版本(git checkout 8605cc3)来分析flask的实现,试图理清flask中的一些概念,加深读者对flask的理解,提高对flask的认识.从而 ...