前言:
如今看官们对“centosdocker代理”大体比较着重,你们都想要学习一些“centosdocker代理”的相关知识。那么小编在网络上收集了一些对于“centosdocker代理””的相关资讯,希望同学们能喜欢,大家一起来学习一下吧!#!/bin/bash
PROXY_IP="x.x.x.x"
interface="ens192"
# 配置DNS
nmcli con mod ${interface} ipv4.dns "223.5.5.5"
# 配置代理
export http_proxy="{PROXY_IP}:8118"
export https_proxy="{PROXY_IP}:8118"
# 配置yum源
mv /etc/yum.repos.d /etc/yum.repos.d_bak
cp -r ./yum.repos.d /etc/
yum clean all;yum makecache
yum update -y
yum install -y git wget vim net-tools bind-utils
# 在线安装docker
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo
yum install -y docker-ce
mkdir -p /etc/systemd/system/docker.service.d
cat >> /etc/systemd/system/docker.service.d/http-proxy.conf <[Service]
Environment="HTTP_PROXY={PROXY_IP}:1080"
EOF
systemctl enable docker && systemctl restart docker
标签: #centosdocker代理