Docker 日常总结

Docker 日常总结

1.删除镜像之前批量删除镜像记录

docker ps -a |grep -e gateway-dev |awk '{print $1}'|xargs docker rm

2.错误

error:
四月 26, 2020 5:03:07 下午 org.apache.http.impl.execchain.RetryExec execute
信息: I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: Permission denied
四月 26, 2020 5:03:07 下午 org.apache.http.impl.execchain.RetryExec execute
信息: Retrying request to {}->unix://localhost:80
四月 26, 2020 5:03:07 下午 org.apache.http.impl.execchain.RetryExec execute
信息: I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: Permission denied
四月 26, 2020 5:03:07 下午 org.apache.http.impl.execchain.RetryExec execute
信息: Retrying request to {}->unix://localhost:80
四月 26, 2020 5:03:07 下午 org.apache.http.impl.execchain.RetryExec execute
信息: I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: Permission denied
四月 26, 2020 5:03:07 下午 org.apache.http.impl.execchain.RetryExec execute
信息: Retrying request to {}->unix://localhost:80

默认情况下,docker命令会使用 Unix socket 与 Docker 引擎通讯。而只有 root 用户和 docker 组的用户才可以访问 Docker 引擎的 Unix socket。出于安全考虑,一般 Linux 系统上不会直接使用 root 用户。因此,更好地做法是将需要使用 docker 的用户加入 docker 用户组。

chmod 777 /var/run/docker.sock

或者

usermod -a -G docker jenkins

3.docker login时出现

Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
docker client 没有启动

4.docker 配置私有仓库

(1) 配置私有仓库

 vim /etc/sysconfig/docker
OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false --insecure-registry 自己的仓库.com'

登陆

docker login 自己的仓库.com
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值