From a352400f7e383d6fd751ec316632a68fef684dc6 Mon Sep 17 00:00:00 2001 From: "anisha.kj" Date: Fri, 7 Feb 2020 10:01:53 +0000 Subject: [PATCH 1/3] Customised docker file for docker swarm Signed-off-by: anisha.kj --- docker/Dockerfile-swarm | 12 ++++++++++++ docker/zoo.cfg.swarm | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 docker/Dockerfile-swarm create mode 100644 docker/zoo.cfg.swarm diff --git a/docker/Dockerfile-swarm b/docker/Dockerfile-swarm new file mode 100644 index 000000000..789ebfb36 --- /dev/null +++ b/docker/Dockerfile-swarm @@ -0,0 +1,12 @@ +# +# Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# + +FROM zookeeper:3.5.6 +COPY zoo.cfg.swarm /conf/zoo.cfg diff --git a/docker/zoo.cfg.swarm b/docker/zoo.cfg.swarm new file mode 100644 index 000000000..5d0ba1eaf --- /dev/null +++ b/docker/zoo.cfg.swarm @@ -0,0 +1,12 @@ +dataDir=/data +dataLogDir=/datalog +tickTime=2000 +initLimit=5 +syncLimit=2 +autopurge.snapRetainCount=3 +autopurge.purgeInterval=0 +maxClientCnxns=60 +standaloneEnabled=true +admin.enableServer=true +server.1=localhost:2888:3888;2181 +4lw.commands.whitelist=cons, envi, conf, crst, srvr, stat, mntr, ruok From b3122fde18458883b133dfe3e4f7450a4320ab50 Mon Sep 17 00:00:00 2001 From: "anisha.kj" Date: Fri, 7 Feb 2020 10:32:15 +0000 Subject: [PATCH 2/3] changed zookeeper vesrion Signed-off-by: anisha.kj --- docker/Dockerfile-swarm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile-swarm b/docker/Dockerfile-swarm index 789ebfb36..36dba45bb 100644 --- a/docker/Dockerfile-swarm +++ b/docker/Dockerfile-swarm @@ -8,5 +8,5 @@ # http://www.apache.org/licenses/LICENSE-2.0 # -FROM zookeeper:3.5.6 +FROM zookeeper:3.5.5 COPY zoo.cfg.swarm /conf/zoo.cfg From 1631a659eb3142e28215014979959c0c7211b64d Mon Sep 17 00:00:00 2001 From: "anisha.kj" Date: Mon, 10 Feb 2020 08:16:06 +0000 Subject: [PATCH 3/3] Modified Makefile to build the swarm image Signed-off-by: anisha.kj --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c15cac5c0..df482787a 100644 --- a/Makefile +++ b/Makefile @@ -54,17 +54,21 @@ build-zk-image: docker build --build-arg VERSION=$(VERSION) --build-arg GIT_SHA=$(GIT_SHA) -t $(APP_REPO):$(VERSION) ./docker docker tag $(APP_REPO):$(VERSION) $(APP_REPO):latest +build-zk-image-swarm: + docker build --build-arg VERSION=$(VERSION)-swarm --build-arg GIT_SHA=$(GIT_SHA) -f ./docker/Dockerfile-swarm -t $(APP_REPO):$(VERSION)-swarm ./docker + test: go test $$(go list ./... | grep -v /vendor/) -race -coverprofile=coverage.txt -covermode=atomic login: @docker login -u "$(DOCKER_USER)" -p "$(DOCKER_PASS)" -push: build-image build-zk-image login +push: build-image build-zk-image build-zk-image-swarm login docker push $(REPO):$(VERSION) docker push $(REPO):latest docker push $(APP_REPO):$(VERSION) docker push $(APP_REPO):latest + docker push $(APP_REPO):$(VERSION)-swarm docker tag $(REPO):$(VERSION) $(ALTREPO):$(VERSION) docker tag $(REPO):$(VERSION) $(ALTREPO):latest docker tag $(APP_REPO):$(VERSION) $(APP_ALTREPO):$(VERSION)