Remove not used code in set_docker_mirror.sh (#12738)

Signed-off-by: Jenny Li <jing.li@zilliz.com>
pull/12452/head
Jenny Li 2021-12-08 15:07:50 +08:00 committed by GitHub
parent 8b309eed80
commit 1674dd5329
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 12 deletions

View File

@ -5,18 +5,8 @@ set -e
MIRROR_URL="http://10.201.177.237:5000"
set_daemon_json_file(){
DOCKER_DAEMON_JSON_FILE="/etc/docker/daemon.json"
if test -f ${DOCKER_DAEMON_JSON_FILE}
then
cp ${DOCKER_DAEMON_JSON_FILE} "${DOCKER_DAEMON_JSON_FILE}.bak"
if grep -q registry-mirrors "${DOCKER_DAEMON_JSON_FILE}.bak";then
cat "${DOCKER_DAEMON_JSON_FILE}.bak" | sed -n "1h;1"'!'"H;\${g;s|\"registry-mirrors\":\s*\[[^]]*\]|\"registry-mirrors\": [\"${MIRROR_URL}\"]|g;p;}" | tee ${DOCKER_DAEMON_JSON_FILE}
else
cat "${DOCKER_DAEMON_JSON_FILE}.bak" | sed -n "s|{|{\"registry-mirrors\": [\"${MIRROR_URL}\"],|g;p;" | tee ${DOCKER_DAEMON_JSON_FILE}
fi
else
mkdir -p "/etc/docker"
echo "{\"registry-mirrors\": [\"${MIRROR_URL}\"]}" | tee ${DOCKER_DAEMON_JSON_FILE}
fi
mkdir -p "/etc/docker"
echo "{\"registry-mirrors\": [\"${MIRROR_URL}\"]}" | tee ${DOCKER_DAEMON_JSON_FILE}
}
restart_docker () {
echo "set-mirror.sh] service docker start"