mirror of https://github.com/easzlab/kubeasz.git
Add docker proxy config at ezdown
parent
6786d45f3c
commit
5d59f8c06f
25
ezdown
25
ezdown
|
@ -177,6 +177,31 @@ EOF
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# docker proxy setting
|
||||||
|
http_proxy=${http_proxy:-}
|
||||||
|
HTTP_PROXY=${HTTP_PROXY:-$http_proxy}
|
||||||
|
https_proxy=${https_proxy:-}
|
||||||
|
HTTPS_PROXY=${HTTPS_PROXY:-$https_proxy}
|
||||||
|
USE_PROXY=0
|
||||||
|
CONFIG="[Service]\n"
|
||||||
|
|
||||||
|
if [[ ! -z ${HTTP_PROXY} ]]; then
|
||||||
|
USE_PROXY=1
|
||||||
|
CONFIG=${CONFIG}"Environment=HTTP_PROXY=${HTTP_PROXY}\n"
|
||||||
|
fi
|
||||||
|
if [[ ! -z ${HTTPS_PROXY} ]]; then
|
||||||
|
USE_PROXY=1
|
||||||
|
CONFIG=${CONFIG}"Environment=HTTPS_PROXY=${HTTPS_PROXY}\n"
|
||||||
|
fi
|
||||||
|
if [[ ${USE_PROXY} == 1 ]]; then
|
||||||
|
logger debug "generate docker service http proxy file"
|
||||||
|
mkdir -p /etc/systemd/system/docker.service.d
|
||||||
|
c=$(echo -e ${CONFIG})
|
||||||
|
cat > /etc/systemd/system/docker.service.d/http-proxy.conf << EOF
|
||||||
|
${c}
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -e /etc/centos-release || -e /etc/redhat-release ]]; then
|
if [[ -e /etc/centos-release || -e /etc/redhat-release ]]; then
|
||||||
logger debug "turn off selinux in CentOS/Redhat"
|
logger debug "turn off selinux in CentOS/Redhat"
|
||||||
getenforce|grep Disabled || setenforce 0
|
getenforce|grep Disabled || setenforce 0
|
||||||
|
|
Loading…
Reference in New Issue