Skip to content

Commit

Permalink
Merge pull request #1184 from ywk253100/161129_push_photon
Browse files Browse the repository at this point in the history
Push photon to project library
  • Loading branch information
reasonerjt authored Nov 29, 2016
2 parents f237d33 + 3e35597 commit c214d37
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tools/ova/script/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ function configureDockerDNS {
do
if [ -n "$d" ]
then
opts="--dns=$d $opts"
opts="$opts --dns=$d"
fi
done
rm /tmp/dns

domain=$(sed -n -e 's/^domain //p' /etc/resolv.conf)
if [ -n "$domain" ]
then
opts="--dns-search=$domain $opts"
opts="$opts --dns-search=$domain"
fi

search=$(sed -n -e 's/^search //p' /etc/resolv.conf)
Expand All @@ -123,12 +123,24 @@ function configureDockerDNS {
do
if [ -n "$s" ]
then
opts="--dns-search=$s $opts"
opts="$opts --dns-search=$s"
fi
done
fi

echo Setting docker: $opts
echo DOCKER_OPTS=$opts > /etc/default/docker
systemctl restart docker
}

function pushPhoton {
set +e
basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
registry_version=$(sed -n -e 's|.*library/registry:||p' $basedir/../harbor/docker-compose.yml)
docker run -d --name photon_pusher -v /data/registry:/var/lib/registry -p 5000:5000 registry:$registry_version
docker tag photon:1.0 127.0.0.1:5000/library/photon:1.0
sleep 5
docker push 127.0.0.1:5000/library/photon:1.0
docker rm -f photon_pusher
set -e
}
3 changes: 3 additions & 0 deletions tools/ova/script/firstboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ tar -zxvf $base_dir/../harbor-offline-installer*.tgz -C $base_dir/../
echo "Loading images..."
load

echo "Pushing photon to project library..."
pushPhoton

echo "Configuring Harbor..."
chmod 600 $base_dir/../harbor/harbor.cfg

Expand Down

0 comments on commit c214d37

Please sign in to comment.