diff options
-rwxr-xr-x | boot/dcae2_vm_init.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/boot/dcae2_vm_init.sh b/boot/dcae2_vm_init.sh index e4288195..17ab0034 100755 --- a/boot/dcae2_vm_init.sh +++ b/boot/dcae2_vm_init.sh @@ -48,7 +48,18 @@ then fi # clean up old network configuration in docker engine -docker network rm config_default +set +e +if [ -n "$(docker ps -q -a)" ]; then + docker stop $(docker ps -q -a) + docker update --restart=no $(docker ps -a -q) + systemctl restart docker + docker rm $(docker ps -q -a) + if [ -n "$(docker network ls | grep 'config_default')" ]; then + docker network rm config_default + fi +fi +set -e + docker login -u "$NEXUS_USER" -p "$NEXUS_PASSWORD" "$NEXUS_DOCKER_REPO" |