Liunx 主机不能连外网安装软件的方法,采用(配置私有仓 或 代理方式)实现
1.局域网搭有仓地址:http://192.168.223.56:8000/
2.配置私有仓命令
rm -f /etc/yum.repos.d/* cat <<EOF > /etc/yum.repos.d/k8s.repo [mes] name=Server baseurl=http://192.168.223.56:8000/ enabled=1 gpgcheck=0 EOF
1.在可以连接外网的主机,打开CCProxy
2.添加Proxy代理主机信息
格式如下:proxy = http://username:password@proxy_ip:port/
vim /etc/yum.conf proxy= http://192.168.224.xxx:808
3.Docker配置Docker Proxy代理主机信息
停用Docker
systemctl stop docker
添加Docker Proxy代理----在 Service 部分下 增加 Environment 变量,配置成你自己的代理地址
vim /lib/systemd/system/docker.service [Service] Environment="HTTP_PROXY=http://192.168.206.xxx:808" "HTTPS_PROXY=http://192.168.206.xxx:808"
重载所有修改过的配置文件
systemctl daemon-reload
启动Docker
systemctl start docker
守护进程重启 systemctl daemon-reload
启动 systemctl start docker
关闭 systemctl stop docker
重启 systemctl restart docker
状态 systemctl status docker
开机启动 systemctl enable docker
查询仓库Docker版本 yum list docker-ce --showduplicates | sort -r
查询 docker search mssql
查看镜像 docker images
运行Docker docker run hello-world
查看运行中的Docker docker ps
安装 yum install docker-ce docker-ce-cli containerd.io
卸载 yum remove policycoreutils-2.5-34.el7.x86_64 -y
Liunx 主机不能连外网安装软件的方法(采用配置私有仓或代理方式)
原文:https://www.cnblogs.com/pcbren/p/13258470.html