mirror of https://github.com/dapr/quickstarts.git
[pubsub] migrate from acr to dockerhub (#54)
* migrate from acr to dockerhub * add makefile
This commit is contained in:
parent
0eb827c179
commit
a817c9c171
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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))))
|
||||
Loading…
Reference in New Issue