Browse Source

add microservice

master
zeus 4 years ago
parent
commit
1ab4facfcd
  1. 19
      install/usr/share/swarmlab.io/sec/swarmlab-sec

19
install/usr/share/swarmlab.io/sec/swarmlab-sec

@ -183,14 +183,9 @@ if [ "$Wdir" == "$HOME" ]; then
echo "##### Create project #####" echo "##### Create project #####"
echo "# -----------------------------------------------" echo "# -----------------------------------------------"
# clean old images
#docker rmi $(docker images -f "dangling=true" -q)
rm -f $Wdir/out.log 2> /dev/null search='ok'
if [ $search == 'ok' ]
error="Error:";
IMAGE=$(docker inspect --type=image $REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME:latest 2>&1 | tee $Wdir/out.log)
if search=$(grep "$error" $Wdir/out.log)
then then
echo ">>> Load Origin " echo ">>> Load Origin "
cat << EOF > $Wdir/Dockerfile cat << EOF > $Wdir/Dockerfile
@ -246,13 +241,9 @@ cat << EOF > $Wdir/docker-compose.yml
version: "2" version: "2"
services: services:
# registry:
# image: registry
# ports:
# - "${REGISTRY_PORT}:5000"
masterservice: masterservice:
image: $REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME image: ${IMAGE_origin}
privileged: true privileged: true
environment: environment:
- NODENAME=${NODENAME} - NODENAME=${NODENAME}
@ -271,7 +262,7 @@ services:
workerservice: workerservice:
image: $REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME image: ${IMAGE_origin}
privileged: true privileged: true
environment: environment:
- NODENAME=${NODENAME} - NODENAME=${NODENAME}
@ -668,7 +659,7 @@ elif [ $COMMAND_RELOAD -eq 1 ]; then
create_dockerfile create_dockerfile
down_master down_master
down_workers down_workers
build_and_push_image #build_and_push_image
up_master up_master
up_workers up_workers

Loading…
Cancel
Save