mirror of https://github.com/milvus-io/milvus.git
Remove not used code in set_docker_mirror.sh (#12738)
Signed-off-by: Jenny Li <jing.li@zilliz.com>pull/12452/head
parent
8b309eed80
commit
1674dd5329
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue