5 pushd "${1:-/home/opnfv/functest/images}" > /dev/null
7 http_proxy=${http_proxy:-http://proxy:8080}
8 https_proxy=${https_proxy:-${http_proxy:-http://proxy:8080}}
9 ftp_proxy=${ftp_proxy:-${http_proxy:-http://proxy:8080}}
10 no_proxy=${no_proxy:-"10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"}
13 ubuntu-14.04-server-cloudimg-amd64-disk1.img \
14 ubuntu-16.04-server-cloudimg-amd64-disk1.img"}
18 http_proxy=${http_proxy}
19 HTTP_PROXY=${http_proxy}
20 https_proxy=${https_proxy}
21 HTTPS_PROXY=${https_proxy}
22 ftp_proxy=${ftp_proxy}
23 FTP_PROXY=${ftp_proxy}
31 Acquire::http::Proxy "${http_proxy}";
32 Acquire::https::Proxy "${https_proxy}";
37 for image in $images; do
38 if [ ! -f "$image" ]; then
39 echo "skip ${image} ($(pwd)/${image} not found)"
42 guestmount -a "${image}" -i --rw "${tmpdir}"
43 add_proxy "${tmpdir}/etc/environment"
44 if [[ ${image} == "ubuntu"* ]]; then
45 add_proxy_apt "${tmpdir}/etc/apt/apt.conf"
47 guestunmount "${tmpdir}"
50 sudo docker load -i cloudify-docker-manager-community-19.01.24.tar
51 dockerfile=${tmpdir}/Dockerfile
52 cat << EOF > $dockerfile
53 FROM docker-cfy-manager:latest
54 ENV HTTP_PROXY "${http_proxy}"
55 ENV HTTPS_PROXY "${https_proxy}"
56 ENV NO_PROXY "${no_proxy}"
58 for f in /etc/sysconfig/cloudify-mgmtworker /etc/sysconfig/cloudify-restservice; do \
59 cat << EOF >> $dockerfile
61 RUN echo "http_proxy=${http_proxy}" >> $f
62 RUN echo "https_proxy=${https_proxy}" >> $f
63 RUN echo "HTTP_PROXY=${http_proxy}" >> $f
64 RUN echo "HTTPS_PROXY=${https_proxy}" >> $f
65 RUN echo "no_proxy=${no_proxy}" >> $f
68 sudo docker build -t docker-cfy-manager -f $dockerfile ${tmpdir}
70 docker-cfy-manager > cloudify-docker-manager-community-19.01.24.tar
71 sudo docker rmi docker-cfy-manager