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