mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 02:05:41 +01:00
ova dns
This commit is contained in:
parent
871c18df46
commit
4149e74b00
@ -90,4 +90,45 @@ function configureHarborCfg {
|
||||
then
|
||||
sed -i -r s%"#?$cfg_key\s*=\s*.*"%"$cfg_key = $cfg_value"% $cfg_file
|
||||
fi
|
||||
}
|
||||
|
||||
function configureDockerDNS {
|
||||
echo "Resetting DNS using vami_ovf_process..."
|
||||
/opt/vmware/share/vami/vami_ovf_process --setnetwork || true
|
||||
|
||||
sed -n -e 's/^nameserver //p' /etc/resolv.conf > /tmp/dns
|
||||
readarray dns < /tmp/dns
|
||||
|
||||
opts=""
|
||||
for d in "${dns[@]}"
|
||||
do
|
||||
if [ -n "$d" ]
|
||||
then
|
||||
opts="--dns=$d $opts"
|
||||
fi
|
||||
done
|
||||
rm /tmp/dns
|
||||
|
||||
domain=$(sed -n -e 's/^domain //p' /etc/resolv.conf)
|
||||
if [ -n "$domain" ]
|
||||
then
|
||||
opts="--dns-search=$domain $opts"
|
||||
fi
|
||||
|
||||
search=$(sed -n -e 's/^search //p' /etc/resolv.conf)
|
||||
if [ -n "$search" ]
|
||||
then
|
||||
searcharray=($search)
|
||||
for s in "${searcharray[@]}"
|
||||
do
|
||||
if [ -n "$s" ]
|
||||
then
|
||||
opts="--dns-search=$s $opts"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo Setting docker: $opts
|
||||
echo DOCKER_OPTS=$opts > /etc/default/docker
|
||||
systemctl restart docker
|
||||
}
|
@ -139,7 +139,7 @@ function detectHostname {
|
||||
# echo "Get hostname from ovfenv: $hostname"
|
||||
# return
|
||||
#fi
|
||||
echo "Resetting DNS and hostname using vami_ovf_process..."
|
||||
echo "Resetting hostname using vami_ovf_process..."
|
||||
/opt/vmware/share/vami/vami_ovf_process --setnetwork || true
|
||||
hostname=$(hostname --fqdn) || true
|
||||
if [ -n $hostname ]
|
||||
|
@ -25,8 +25,10 @@ addIptableRules
|
||||
echo "Installing docker compose..."
|
||||
installDockerCompose
|
||||
|
||||
echo "Starting docker service..."
|
||||
systemctl start docker
|
||||
#echo "Starting docker service..."
|
||||
#systemctl start docker
|
||||
echo "Configuring docker..."
|
||||
configureDockerDNS
|
||||
|
||||
echo "Uncompress Harbor offline instaler tar..."
|
||||
tar -zxvf $base_dir/../harbor-offline-installer*.tgz -C $base_dir/../
|
||||
|
@ -33,6 +33,9 @@ fi
|
||||
echo "Configuring Harbor..."
|
||||
configure
|
||||
|
||||
echo "Configuring docker..."
|
||||
configureDockerDNS
|
||||
|
||||
#Start Harbor
|
||||
echo "Starting Harbor..."
|
||||
up
|
||||
|
Loading…
Reference in New Issue
Block a user