From a817c9c17165aeca11da6462ad9f7c98c822151f Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Tue, 15 Oct 2019 16:23:31 -0700 Subject: [PATCH] [pubsub] migrate from acr to dockerhub (#54) * migrate from acr to dockerhub * add makefile --- 4.pub-sub/deploy/node-subscriber.yaml | 2 +- 4.pub-sub/deploy/python-subscriber.yaml | 2 +- 4.pub-sub/deploy/react-form.yaml | 2 +- 4.pub-sub/makefile | 45 +++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 4.pub-sub/makefile diff --git a/4.pub-sub/deploy/node-subscriber.yaml b/4.pub-sub/deploy/node-subscriber.yaml index b15a6b44..8d140e1e 100644 --- a/4.pub-sub/deploy/node-subscriber.yaml +++ b/4.pub-sub/deploy/node-subscriber.yaml @@ -20,7 +20,7 @@ spec: spec: containers: - name: node-subscriber - image: actionscore.azurecr.io/dapr_samples/node-subscriber + image: dapriosamples/pubsub-node-subscriber ports: - containerPort: 3000 imagePullPolicy: Always \ No newline at end of file diff --git a/4.pub-sub/deploy/python-subscriber.yaml b/4.pub-sub/deploy/python-subscriber.yaml index f017961d..ec28147d 100644 --- a/4.pub-sub/deploy/python-subscriber.yaml +++ b/4.pub-sub/deploy/python-subscriber.yaml @@ -20,7 +20,7 @@ spec: spec: containers: - name: python-subscriber - image: actionscore.azurecr.io/dapr_samples/python-subscriber + image: dapriosamples/pubsub-python-subscriber ports: - containerPort: 5000 imagePullPolicy: Always \ No newline at end of file diff --git a/4.pub-sub/deploy/react-form.yaml b/4.pub-sub/deploy/react-form.yaml index ad19100a..e454389c 100644 --- a/4.pub-sub/deploy/react-form.yaml +++ b/4.pub-sub/deploy/react-form.yaml @@ -36,7 +36,7 @@ spec: spec: containers: - name: react-form - image: actionscore.azurecr.io/dapr_samples/react-form + image: dapriosamples/pubsub-react-form ports: - containerPort: 8080 imagePullPolicy: Always diff --git a/4.pub-sub/makefile b/4.pub-sub/makefile new file mode 100644 index 00000000..bb4b9dfd --- /dev/null +++ b/4.pub-sub/makefile @@ -0,0 +1,45 @@ +DOCKER_IMAGE_PREFIX ?=pubsub- +APPS ?=node-subscriber python-subscriber react-form + +SAMPLE_REGISTRY ?=docker.io/dapriosamples +SAMPLE_VERSION ?=latest + +# Docker image build and push setting +DOCKER:=docker +DOCKERFILE:=Dockerfile + +.PHONY: build + +SAMPLE_APPS:=$(foreach ITEM,$(APPS),$(DOCKER_IMAGE_PREFIX)$(ITEM)) +build: $(SAMPLE_APPS) + +# Generate docker image build targets +# Params: +# $(1): app name +# $(2): tag name +define genDockerImageBuild +.PHONY: $(DOCKER_IMAGE_PREFIX)$(1) +$(DOCKER_IMAGE_PREFIX)$(1): + $(DOCKER) build -f $(1)/$(DOCKERFILE) $(1)/. -t $(SAMPLE_REGISTRY)/$(DOCKER_IMAGE_PREFIX)$(1):$(2) +endef + +# Generate docker image build targets +$(foreach ITEM,$(APPS),$(eval $(call genDockerImageBuild,$(ITEM),$(SAMPLE_VERSION)))) + +# push docker image to the registry +.PHONY: push +PUSH_SAMPLE_APPS:=$(foreach ITEM,$(APPS),push-$(DOCKER_IMAGE_PREFIX)$(ITEM)) +push: $(PUSH_SAMPLE_APPS) + +# Generate docker image push targets +# Params: +# $(1): app name +# $(2): tag name +define genDockerImagePush +.PHONY: push-$(DOCKER_IMAGE_PREFIX)$(1) +push-$(DOCKER_IMAGE_PREFIX)$(1): + $(DOCKER) push $(SAMPLE_REGISTRY)/$(DOCKER_IMAGE_PREFIX)$(1):$(2) +endef + +# Generate docker image push targets +$(foreach ITEM,$(APPS),$(eval $(call genDockerImagePush,$(ITEM),$(SAMPLE_VERSION)))) \ No newline at end of file