From 88ea912273e7765844d1eefe21ab44c8ec63d076 Mon Sep 17 00:00:00 2001 From: zeus Date: Thu, 1 Apr 2021 02:15:15 +0300 Subject: [PATCH] add microservice --- .../usr/share/swarmlab.io/sec/swarmlab-sec | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/install/usr/share/swarmlab.io/sec/swarmlab-sec b/install/usr/share/swarmlab.io/sec/swarmlab-sec index 9def8a3..d243e9f 100755 --- a/install/usr/share/swarmlab.io/sec/swarmlab-sec +++ b/install/usr/share/swarmlab.io/sec/swarmlab-sec @@ -37,7 +37,7 @@ EOF # PACKAGES enabled ths with apt-get update && apt-get $APTPARAM install -y openssh-server $PACKAGES in in RUN export DEBIAN_FRONTEND=noninteractive APTPARAM=" --no-install-recommends " IMAGE_local="microservice-nodejs" -HYBRID_NETWORK="microservice-nodejs" +HYBRID_NETWORK="swarmlab-nodejs" # dont edit IMAGE_origin="hub.swarmlab.io:5443/hybrid-nodevuejs:latest" bootstrap="sec_bootstrap" @@ -243,7 +243,7 @@ version: "2" services: masterservice: - image: ${IMAGE_origin} + image: $IMAGE_NAME privileged: true environment: - NODENAME=${NODENAME} @@ -262,7 +262,7 @@ services: workerservice: - image: ${IMAGE_origin} + image: $IMAGE_NAME privileged: true environment: - NODENAME=${NODENAME} @@ -433,17 +433,11 @@ build_and_push_image () { printf "\\n\\n===> BUILD IMAGE" printf "\\n%s\\n" "$HEADER" - echo "$ docker build -t \"$REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME\" ." + echo "$ docker build -t \"$IMAGE_NAME\" ." printf "\\n" - docker build -t "$REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME" . + #docker build -t "$REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME" . + docker build -t "$IMAGE_NAME" . - printf "\\n" - - printf "\\n\\n===> PUSH IMAGE TO REGISTRY" - printf "\\n%s\\n" "$HEADER" - echo "$ docker push \"$REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME\"" - printf "\\n" - docker push "$REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME" } up_master () @@ -627,7 +621,7 @@ if [ $COMMAND_UP -eq 1 ]; then clear_all #up_registry # remove for microservices generate_ssh_keys - #build_and_push_image # remove for microservices + build_and_push_image # remove for microservices up_master up_workers @@ -659,7 +653,7 @@ elif [ $COMMAND_RELOAD -eq 1 ]; then create_dockerfile down_master down_workers - #build_and_push_image + build_and_push_image up_master up_workers