docker配置代理pull报错:proxyconnect tcp: tls: first record does not look like a TLS handshake
1、docker pull mysql报错
[root@k8s docker.service.d]# docker pull mysql
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: proxyconnect tcp: tls: first record does not look like a TLS handshake
2、查看代理配置
[root@k8s docker.service.d]# sudo systemctl show --property=Environment docker
Environment=HTTP_PROXY=http://proxy.scott.net:8081 HTTPS_PROXY=https://proxy.scott.net:8081 NO_PROXY=localhost,127.0.0.1
[root@k8s docker.service.d]#
3、代理配置是参考https://docs.docker.com/config/daemon/systemd/
3.1 Create a systemd drop-in directory for the docker service
sudo mkdir -p /etc/systemd/system/docker.service.d
3.2 Create a file named /etc/systemd/system/docker.service.d/http-proxy.conf
that adds the HTTP_PROXY
environment variable:
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80"
If you are behind an HTTPS proxy server, set the HTTPS_PROXY
environment variable:
[Service]
Environment="HTTPS_PROXY=https://proxy.example.com:443"
Multiple environment variables can be set; to set both a non-HTTPS and a HTTPs proxy;
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80"
Environment="HTTPS_PROXY=https://proxy.example.com:443"
3.3
If you have internal Docker registries that you need to contact without proxying you can specify them via the NO_PROXY
environment variable.
The NO_PROXY
variable specifies a string that contains comma-separated values for hosts that should be excluded from proxying. These are the options you can specify to exclude hosts:
- IP address prefix (
1.2.3.4
) - Domain name, or a special DNS label (
*
) - A domain name matches that name and all subdomains. A domain name with a leading “.” matches subdomains only. For example, given the domains
foo.example.com
andexample.com
:example.com
matchesexample.com
andfoo.example.com
, and.example.com
matches onlyfoo.example.com
- A single asterisk (
*
) indicates that no proxying should be done - Literal port numbers are accepted by IP address prefixes (
1.2.3.4:80
) and domain names (foo.example.com:80
)
Config example:
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80"
Environment="HTTPS_PROXY=https://proxy.example.com:443"
Environment="NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"
3.4 Flush changes and restart Docker
sudo systemctl daemon-reload
sudo systemctl restart docker
3.5 Verify that the configuration has been loaded and matches the changes you made, for example:
sudo systemctl show --property=Environment dockerEnvironment=HTTP_PROXY=http://proxy.example.com:80 HTTPS_PROXY=https://proxy.example.com:443 NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp
4、查看docker info
[root@k8s ~]# docker info
Client:Debug Mode: falseServer:Containers: 0Running: 0Paused: 0Stopped: 0Images: 0Server Version: 19.03.13Storage Driver: overlay2Backing Filesystem: xfsSupports d_type: trueNative Overlay Diff: trueLogging Driver: json-fileCgroup Driver: cgroupfsPlugins:Volume: localNetwork: bridge host ipvlan macvlan null overlayLog: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslogSwarm: inactiveRuntimes: runcDefault Runtime: runcInit Binary: docker-initcontainerd version: 8fba4e9a7d01810a393d5d25a3621dc101981175runc version: dc9208a3303feef5b3839f4323d9beb36df0a9ddinit version: fec3683Security Options:seccompProfile: defaultKernel Version: 3.10.0-693.el7.x86_64Operating System: CentOS Linux 7 (Core)OSType: linuxArchitecture: x86_64CPUs: 4Total Memory: 2.875GiBName: k8sID: 3547:O4LB:HJ52:ERHQ:2CWG:UURI:FUYC:EK4J:CLEO:LIYS:UWQ3:BFFIDocker Root Dir: /var/lib/dockerDebug Mode: falseHTTP Proxy: http://proxy.scott.net:8081/HTTPS Proxy: https://proxy.scott.net:8081/No Proxy: localhost,127.0.0.1Registry: https://index.docker.io/v1/Labels:Experimental: falseInsecure Registries:127.0.0.0/8Registry Mirrors:https://docker.mirrors.ustc.edu.cn/Live Restore Enabled: false
5、修改配置文件/etc/systemd/system/docker.service.d/http-proxy.conf
,去掉HTTPS_PROXY
修改前
[root@k8s docker.service.d]# cat https-proxy.conf
[Service]
Environment="HTTP_PROXY=http://proxy.scott.net:8081/" "HTTPS_PROXY=https://proxy.scott.net:8081/" "NO_PROXY=localhost,127.0.0.1"
修改后
[root@k8s docker.service.d]# cat https-proxy.conf
[Service]
Environment="HTTP_PROXY=http://proxy.scott.net:8081/" "NO_PROXY=localhost,127.0.0.1"
docker info
[root@k8s docker.service.d]# docker info
Client:Debug Mode: falseServer:Containers: 0Running: 0Paused: 0Stopped: 0Images: 0Server Version: 19.03.13Storage Driver: overlay2Backing Filesystem: xfsSupports d_type: trueNative Overlay Diff: trueLogging Driver: json-fileCgroup Driver: cgroupfsPlugins:Volume: localNetwork: bridge host ipvlan macvlan null overlayLog: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslogSwarm: inactiveRuntimes: runcDefault Runtime: runcInit Binary: docker-initcontainerd version: 8fba4e9a7d01810a393d5d25a3621dc101981175runc version: dc9208a3303feef5b3839f4323d9beb36df0a9ddinit version: fec3683Security Options:seccompProfile: defaultKernel Version: 3.10.0-693.el7.x86_64Operating System: CentOS Linux 7 (Core)OSType: linuxArchitecture: x86_64CPUs: 4Total Memory: 2.875GiBName: k8sID: 3547:O4LB:HJ52:ERHQ:2CWG:UURI:FUYC:EK4J:CLEO:LIYS:UWQ3:BFFIDocker Root Dir: /var/lib/dockerDebug Mode: falseHTTP Proxy: http://proxy.scott.net:8081/No Proxy: localhost,127.0.0.1Registry: https://index.docker.io/v1/Labels:Experimental: falseInsecure Registries:127.0.0.0/8Registry Mirrors:https://docker.mirrors.ustc.edu.cn/Live Restore Enabled: false
6、Flush changes and restart Docker
sudo systemctl daemon-reload
sudo systemctl restart docker
7、查看docker代理
[root@k8s docker.service.d]# sudo systemctl show --property=Environment docker
Environment=HTTP_PROXY=http://proxy.scott.net:8081/ NO_PROXY=localhost,127.0.0.1
8、pull
[root@k8s docker.service.d]# docker pull mysql
Using default tag: latest
latest: Pulling from library/mysql
bb79b6b2107f: Pull complete
49e22f6fb9f7: Pull complete
842b1255668c: Pull complete
9f48d1f43000: Pull complete
c693f0615bce: Pull complete
8a621b9dbed2: Pull complete
0807d32aef13: Pull complete
a56aca0feb17: Pull complete
de9d45fd0f07: Pull complete
1d68a49161cc: Pull complete
47834b5a7c81: Pull complete
7b0764b0009c: Pull complete
Digest: sha256:b30e3c13ab71f51c7951120826671d56586afb8d9e1988c480b8673c8570eb74
Status: Downloaded newer image for mysql:latest
docker.io/library/mysql:latest
docker配置代理pull报错:proxyconnect tcp: tls: first record does not look like a TLS handshake相关推荐
- 报错 proxyconnect tcp: tls: first record does not look like a TLS handshake
使用代理时出现此报错,解决方案如下 # 报错内容 Error: looks like "https://prometheus-community.github.io/helm-charts& ...
- Windows如何在CMD或PowerShell中配置代理,报错及解决方法
文章目录 Windows代理配置 设置代理 查看代理 取消代理 配置代理时产生的错误 Windows代理配置 有时候,我们在做常规渗透测试的时候,经常在浏览器上挂代理,但不难发现cmd中的ip还是本地 ...
- Docker拉取镜像报错error pulling image configuration
Docker拉取镜像报错error pulling image configuration 在制作docker镜像的时候出现如下报错: xxx@ubuntu:~/Desktop/a$ docker b ...
- 添加https后反向代理gateway报错io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record
添加https后反向代理gateway报错 2023-02-17 14:19:05.328 [reactor-http-epoll-4] ------ ERROR c..si.gateway.exce ...
- docker中安装nacos报错 com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
docker中安装nacos报错 com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception ...
- 【docker】top命令报错 “TERM environment variable not set.”
今天用docker运行top命令报错"TERM environment variable not set." 报错的原因是,top命令的运行需要指定终端类型,也就是一个" ...
- unplugin-auto-import的配置和eslint报错解决
unplugin-auto-import的配置和eslint报错解决 先上官网:unplugin-auto-import unplugin-auto-import 解决了vue3-hook.vue-r ...
- go报错dial tcp xx.xx.xx.xx:443: i/o timeout
踩坑记录 使用go启动服务时,报错dial tcp xx.xx.xx.xx:443: i/o timeout 解决办法:配置goproxy # 配置goproxy export GOPROXY=htt ...
- Docker Quickstart Terminal启动报错“Unable to verify the Docker daemon”和步骤“Finalize”出错
Docker Quickstart Terminal启动报错"Unable to verify the Docker daemon"和步骤"Finalize"出 ...
最新文章
- 编辑Linux系统实验,linux操作系统实验vi编辑器的使用
- qt label显示图片_qt关于qmovie类的使用
- C++ : KMP 字符串匹配算法
- java8中LocalDate、LocalTime、LocalDateTime介绍
- codevs 1052 地鼠游戏
- 轻松实现全国高校地理位置数据爬取(文末附源码和数据集)
- 【java】java 如何抛出 sleep interrupted
- Maven常用命令-创建Java项目
- 我们说的目标导向不是 “唯结果论”
- 早上收到这样一份通知,求一无漏洞框架,无力吐槽
- 【水果识别】基于matalb GUI灰度、二值化、滤波水果分级【含Matlab源码 1848期】
- 理解position:relative 与 position:absolute
- ZedGraph _WINFORM中设置ZEDGRAPH的曲线符号SYMBOL以及对应关系
- 基于OP放大器的有源模拟滤波器设计--一阶有源滤波器
- 防弹咖啡真的能减肥吗?防弹咖啡减肥的原理是什么?
- Android自定义SurfaceView简单实现烟花效果
- 自动售货机html代码,自动售货机系统源代码.doc
- Amazon Prime Video为《周四橄榄球之夜》推出新功能,让全球NFL球迷能够自定义流媒体播放体验
- Xilinx Spartan-6 FPGA开发板硬件说明书(1)
- android霓虹灯跑的动画,Android手机显示多彩霓虹灯效果
热门文章
- Git 技术篇 - github镜像推荐,无需翻墙实现飞速访问github官网
- Mysql入门到放弃
- 贝壳IPO背后最别致的光彩:看不见的价值观
- 服务器基线加固脚本_安全服务之安全基线及加固(一)Windows篇
- k8s可视化管理工具
- matlab 边缘检测 抠图,ps如何调整边缘的流程:边缘检测、调整边缘、输出(调整边缘抠图...
- 用免费新浪云sea搭建个人云服务器
- android x86 鼠标指针,x86中断完全版
- 注册企业腾讯邮箱需要对GoDaddy设置域名解析
- 在linux下恶臭hellotext中作用的?,《Linux内核与程序设计》实验学习笔记