TH小破站

  • 首页
  • 容器
    • 认识Docker
    • DockerFile详解
  • k8s
    • 认识Kubernetes
    • Kubernetes部署--(kubeadm方式)
    • kubeasz部署k8s集群
    • Ansible-binary部署k8s集群-1.31.2
  • Ceph
    • 认识分布式存储
    • CPEH部署
  • CI/CD
    • DevOps认识
    • 部署--Gitlab
  • ELK
    • ELK简介
    • Elasticsearch
    • Kibana部署
    • Logstash
    • ELK--收集 tomcat 日志(实战)
  • HD
    • 认识--大数据
    • Hadoop-单机部署
    • Hadoop-伪分布部署
    • Hadoop-完全分布部署
    • Hadoop-(HA)完全分布部署
    • Ambari自动部署--Hadoop
  • Nginx
    • Nginx功能介绍
    • Nginx安全选项
    • Nginx配置文件简单介绍
    • 网站服务器部署
  • 监控
    • ZABBIX-部署(yum)
    • ZABBIX-编译安装
  • 云计算
    • KVM 概述
    • OpenStack企业级部署(T版)
    • OpenStack之dashboard部署
    • OpenStack-controller的高可用
    • openstack(Caracal版_ubuntu版本)部署
  • 数据库
    • mariadb与mysql
    • mysql主从
    • MySQL--冷备(实战)
    • MySQL--热备(dump表)
    • MySQL--热备(dump库)
    • 数据恢复实战案例
    • Xtrabackup实现MySql8.x全量备份
    • MyCat实现数据库读写分离
    • MHA实现数据库高可用
    • Percona XtraDB(PXC)实现数据库集群高可用
    • 数据库压力测试
    • PostgreSQL 基操
    • PostgreSQL备份恢复
    • PostgreSQL高可用
    • MongDB安装配置基础使用
    • MongoDB实现复制集
    • MongoDB备份还原
  • 自动化
    • ssh远程服务原理及配置
    • Ansible剧本文件应用
    • Ansible管理服务介绍
    • Ansible自动化部署node_exporter(包含升级,回滚)
    • Saltstack-部署安装
  • 脚本
    • 一键查看服务器资源利用率
    • 一键生成SSL证书
    • 保存指定数量的文件/目录
    • 初始化服务器
    • 扫描可用IP
    • 批量分发SSH密钥
    • 监控多主机磁盘脚本
    • 一键安装MySQL8.x脚本
    • Python脚本监控ES集群
    • 资源巡检脚本
    • 查看各用户使用的cpu占比
热衷于分享
架构师成长之路 !!!
  1. 首页
  2. 安全
  3. 正文

如何在你的VMware虚拟机上配置git代理docker代理(让你的机器畅通无阻)

2024年7月21日 1184点热度 0人点赞 0条评论

配置git代理或者docker代理

配置git代理

问题梳理

 root@k8s-master01:~# git clone -b v1.29.4 https://github.com/kubernetes/kubernetes.git
 Cloning into 'kubernetes'...
 fatal: unable to access 'https://github.com/kubernetes/kubernetes.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.

拉取github的项目失败

问题解决

 root@k8s-master01:~# vim /etc/environment
 # 添加下面内容
 http_proxy="http://192.168.139.1:7890"
 https_proxy="http://192.168.139.1:7890"
 ftp_proxy="http://192.168.139.1:7890"
 no_proxy="localhost,127.0.0.1,::1"
 ####IP为代理地址的IP,7890为代理的端口####你必须得有一个能够可用的科学上网工具
 root@k8s-master01:~# source /etc/environment
 root@k8s-master01:~# git config --global http.proxy http://192.168.139.1:7890
 root@k8s-master01:~# git config --global https.proxy http://192.168.139.1:7890
  • 重新拉起代码

 root@k8s-master01:~# git clone -b v1.29.4 https://github.com/kubernetes/kubernetes.git
 Cloning into 'kubernetes'...
 remote: Enumerating objects: 1545595, done.
 remote: Counting objects: 100% (86/86), done.
 remote: Compressing objects: 100% (76/76), done.
 remote: Total 1545595 (delta 29), reused 26 (delta 8), pack-reused 1545509
 Receiving objects: 100% (1545595/1545595), 1.01 GiB | 9.30 MiB/s, done.
 Resolving deltas: 100% (1131041/1131041), done.
 Note: switching to '55019c83b0fd51ef4ced8c29eec2c4847f896e74'.
 ​
 You are in 'detached HEAD' state. You can look around, make experimental
 changes and commit them, and you can discard any commits you make in this
 state without impacting any branches by switching back to a branch.
 ​
 If you want to create a new branch to retain commits you create, you may
 do so (now or later) by using -c with the switch command. Example:
 ​
   git switch -c <new-branch-name>
 ​
 Or undo this operation with:
 ​
   git switch -
 ​
 Turn off this advice by setting config variable advice.detachedHead to false
 ​
 Updating files: 100% (24911/24911), done.

配置 Docker 代理(如果使用 Docker)

 sudo mkdir -p /etc/systemd/system/docker.service.d
 vim /etc/systemd/system/docker.service.d/http-proxy.conf
 #添加以下内容:
 [Service]
 Environment="HTTP_PROXY=http://192.168.139.1:7890"
 Environment="HTTPS_PROXY=http://192.168.139.1:7890"
 systemctl daemon-reload
 systemctl restart docker
 `验证`
 curl -I http://www.google.com
标签: 暂无
最后更新:2024年7月21日

tanghao946

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复
文章目录
  • 配置git代理或者docker代理
    • 配置git代理
      • 问题梳理
      • 问题解决
    • 配置 Docker 代理(如果使用 Docker)

COPYRIGHT © 2025 TH小破站. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

渝ICP备2023013789号

渝公网安备50011702500926号