【问题记录】conda与docker踩坑记录(关于SSL Error与NameResolutionError)

conda与docker踩坑记录

业务背景:需要创建一个conda的docker容器,在容器中创建环境并安装相应的包。之前在使用conda时,使用的代理为默认的default,没有遇到网络相关的问题。最近在使用Dockerfile构建有conda环境的容器时,遇到两个问题。
1.在conda create时,遇到SSL:WRONG_VERSION_NUMBER _ssl.c:1000。
2.在使用Dockerfile构建容器时,遇到NameResolutionError。

1.SSL:WRONG_VERSION_NUMBER _ssl.c:1000问题总结

问题产生场景: 在使用Dockerfile构建容器时,conda create命令与conda install命令在执行时,遇到SSL版本错误问题。
在这里插入图片描述

解决方法:
1.尝试更新SSL版本(无用)
2.核查主机上所有代理(无用,主机上之前没配置过任何代理)
3.更新conda的镜像源(有用)

channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  deepmodeling: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/

2.使用Dockerfile构建容器时遇到NameResolutionError问题

问题产生场景: 在使用Dockerfile构建容器时,处理完SSL:WRONG VERSION NUMBER问题后,报错。
在这里插入图片描述
解决办法:
执行docker的重启命令。

sudo service docker restart
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值