From 8ef389381688e96f1aba089e98342c94c4b4fb88 Mon Sep 17 00:00:00 2001 From: beierlm Date: Fri, 19 Feb 2021 09:34:57 -0500 Subject: [PATCH] Correct Docker Proxy Syntax Updates the syntax for managing the docker proxy so we can avoid the rate limit issue Change-Id: I29f9da9f7b3af57dd1614ded595d463c4ef14f9e Signed-off-by: beierlm --- installers/full_install_osm.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index f69d4c19..05bfd062 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -412,18 +412,18 @@ function install_docker_ce() { echo "Configuring docker proxy ..." if [ -f /etc/docker/daemon.json ]; then if grep -q registry-mirrors /etc/docker/daemon.json; then - sudo sed -Ei 's/("registry-mirrors".*\[)(.*)\]/\1\2, \"'"${DOCKER_PROXY_URL}"'\"\]/' /etc/docker/daemon.json + sudo sed -i "s|registry-mirrors.*|registry-mirrors\": [\"${DOCKER_PROXY_URL}\"] |" /etc/docker/daemon.json else - sudo sed -i 's/{/{\n "registry-mirrors": [\"'"${DOCKER_PROXY_URL}"'\"]",/' /etc/docker/daemon.json + sudo sed -i "s|{|{\n \"registry-mirrors\": [\"${DOCKER_PROXY_URL}\"],|" /etc/docker/daemon.json fi else - sudo cat << EOF > /etc/docker/daemon.json + sudo bash -c "cat << EOF > /etc/docker/daemon.json { - "registry-mirrors": ["${DOCKER_PROXY_URL}"] + \"registry-mirrors\": [\"${DOCKER_PROXY_URL}\"] } -EOF +EOF" fi - sudo systemctl daemon-reload + sudo systemctl daemon-reload sudo service docker restart echo "... restarted Docker service again" fi -- 2.25.1