设为首页 收藏本站
查看: 1519|回复: 0

[经验分享] 配置docker本地仓库遇到的一些问题

[复制链接]

尚未签到

发表于 2019-2-21 13:01:42 | 显示全部楼层 |阅读模式
  在执行一下命令的时候遇到一些问题,记录如下:
  000
  # pip install docker-registry
  Searching for M2Crypto==0.22.3
  Reading https://pypi.python.org/simple/M2Crypto/
  Best match: M2Crypto 0.22.3
  Downloading https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.22.3.tar.gz#md5=573f21aaac7d5c9549798e72ffcefedd
  Processing M2Crypto-0.22.3.tar.gz
  Writing /tmp/easy_install-vVPR1Z/M2Crypto-0.22.3/setup.cfg
  Running M2Crypto-0.22.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-vVPR1Z/M2Crypto-0.22.3/egg-dist-tmp-3c7TJ3
  SWIG/_m2crypto.i:30: Error: Unable to find 'openssl/opensslv.h'
  SWIG/_m2crypto.i:33: Error: Unable to find 'openssl/safestack.h'
  SWIG/_evp.i:12: Error: Unable to find 'openssl/opensslconf.h'
  SWIG/_ec.i:7: Error: Unable to find 'openssl/opensslconf.h'
  error: Setup script exited with error: command 'swig' failed with exit status
  解决办法是安装 openssl-devel:
  # yum install -y openssl-devel.x86_64
  001
  重新执行 pip install docker-registry
  Searching for M2Crypto==0.22.3
  Reading https://pypi.python.org/simple/M2Crypto/
  Best match: M2Crypto 0.22.3
  Downloading https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.22.3.tar.gz#md5=573f21aaac7d5c9549798e72ffcefedd
  Processing M2Crypto-0.22.3.tar.gz
  Writing /tmp/easy_install-5hkA4l/M2Crypto-0.22.3/setup.cfg
  Running M2Crypto-0.22.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-5hkA4l/M2Crypto-0.22.3/egg-dist-tmp-pZ_OGN
  /usr/include/openssl/opensslconf.h:36: Error: CPP #error ""This openssl-devel package does not work your architecture?"". Use the -cpperraswarn option to continue swig processing.
  error: Setup script exited with error: command 'swig' failed with exit status
  解决办法是手动安装 M2Crypto 0.22.3 (M2Crypto 0.22.3在centos7上安装会有一些问题需要借助脚本)
  1. 下载 M2Crypto-0.22.3.tar.gz
  wget https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.22.3.tar.gz   #下载源码
  tar zxvf M2Crypto/M2Crypto-0.22.3.tar.gz    # 解压
  cd M2Crypto-0.22.3
  2. 然后创建安装脚本,内容如下:
  # vim fedora_setup.sh
  #!/bin/sh
  # This script is meant to work around the differences on Fedora Core-based# distributions (Redhat, CentOS, ...) compared to other common Linux
  # distributions.
  #
  # Usage: ./fedora_setup.sh [setup.py options]
  #
  arch=`uname -m`
  for i in SWIG/_{ec,evp}.i; do
  sed -i -e "s/opensslconf\./opensslconf-${arch}\./" "$i"
  done
  SWIG_FEATURES=-cpperraswarn python setup.py $*
  3. 然后为脚本添加执行权限,执行脚本,并安装M2Crypto 0.22.3
  # chmod +x fedora_setup.sh
  # ./fedora_setup.sh build
  # python setup.py install
  至此可以完成安装,需要注意的是私有仓库的配置文件 config_sample.yml在以下路径
  /usr/lib/python2.7/site-packages/docker_registry-1.0.0_dev-py2.7.egg/config
  002
  配置完成后启动服务,push镜像的时候又有如下错误:
  docker pull 172.16.18.159:5000/ubuntu:12.04
  Error: Invalid registry endpoint https://172.16.18.159:5000/v1/: Get https://172.16.18.159:5000/v1/_ping: EOF. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry http://172.16.18.159:5000` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/http://172.16.18.159:5000/ca.crt
  解决方法是在docker的配置文件里面OPTIONS添加 –insecure-registry http://172.16.18.159:5000 选项
  # /etc/sysconfig/docker
  # Modify these options if you want to change the way the docker daemon runs
  OPTIONS='--selinux-enabled --insecure-registry 172.16.18.159:5000'
  DOCKER_CERT_PATH=/etc/docker
  然后重启docker服务:
  # systemctl restart docker
  至此错误全部解决,本地仓库配置成功
  附:
  
M2Crypto-0.22.3.tar

  http://down.运维网.com/data/2446591




运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-675387-1-1.html 上篇帖子: Docker&harbor 下篇帖子: Centos版的安装docker
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表