images/image-builder/tools/docker_proxy.sh
Dinesh Garg 353b302eed Allow image builder and bootstrap_capo proxy customization
Add proxy/no_proxy in bootstrap_capo Makefile and correct/add
proxy/no_proxy in image builder docker proxy playbook

Change-Id: I3dcf3a3303e718f2f8bd5dfa24d9232599249d3f
2020-12-10 11:36:11 +00:00

12 lines
631 B
Bash
Executable File

#!/bin/bash
if [ ! -f /etc/systemd/system/docker.service.d/http-proxy.conf ]; then
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo sh -c 'echo "[Service]" > /etc/systemd/system/docker.service.d/http-proxy.conf'
sudo sh -c "echo \"Environment=\\\"HTTP_PROXY=$1\\\"\" >> /etc/systemd/system/docker.service.d/http-proxy.conf"
sudo sh -c "echo \"Environment=\\\"HTTPS_PROXY=$1\\\"\" >> /etc/systemd/system/docker.service.d/http-proxy.conf"
sudo sh -c "echo \"Environment=\\\"NO_PROXY=$2\\\"\" >> /etc/systemd/system/docker.service.d/http-proxy.conf"
sudo systemctl daemon-reload
sudo systemctl restart docker
fi