mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 04:05:40 +01:00
ova dns
This commit is contained in:
parent
871c18df46
commit
4149e74b00
@ -91,3 +91,44 @@ function configureHarborCfg {
|
|||||||
sed -i -r s%"#?$cfg_key\s*=\s*.*"%"$cfg_key = $cfg_value"% $cfg_file
|
sed -i -r s%"#?$cfg_key\s*=\s*.*"%"$cfg_key = $cfg_value"% $cfg_file
|
||||||
fi
|
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"
|
# echo "Get hostname from ovfenv: $hostname"
|
||||||
# return
|
# return
|
||||||
#fi
|
#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
|
/opt/vmware/share/vami/vami_ovf_process --setnetwork || true
|
||||||
hostname=$(hostname --fqdn) || true
|
hostname=$(hostname --fqdn) || true
|
||||||
if [ -n $hostname ]
|
if [ -n $hostname ]
|
||||||
|
@ -25,8 +25,10 @@ addIptableRules
|
|||||||
echo "Installing docker compose..."
|
echo "Installing docker compose..."
|
||||||
installDockerCompose
|
installDockerCompose
|
||||||
|
|
||||||
echo "Starting docker service..."
|
#echo "Starting docker service..."
|
||||||
systemctl start docker
|
#systemctl start docker
|
||||||
|
echo "Configuring docker..."
|
||||||
|
configureDockerDNS
|
||||||
|
|
||||||
echo "Uncompress Harbor offline instaler tar..."
|
echo "Uncompress Harbor offline instaler tar..."
|
||||||
tar -zxvf $base_dir/../harbor-offline-installer*.tgz -C $base_dir/../
|
tar -zxvf $base_dir/../harbor-offline-installer*.tgz -C $base_dir/../
|
||||||
|
@ -33,6 +33,9 @@ fi
|
|||||||
echo "Configuring Harbor..."
|
echo "Configuring Harbor..."
|
||||||
configure
|
configure
|
||||||
|
|
||||||
|
echo "Configuring docker..."
|
||||||
|
configureDockerDNS
|
||||||
|
|
||||||
#Start Harbor
|
#Start Harbor
|
||||||
echo "Starting Harbor..."
|
echo "Starting Harbor..."
|
||||||
up
|
up
|
||||||
|
Loading…
Reference in New Issue
Block a user