diff --git a/06-building-container-images/api-golang/Makefile b/06-building-container-images/api-golang/Makefile index 1b53676..6f3380c 100644 --- a/06-building-container-images/api-golang/Makefile +++ b/06-building-container-images/api-golang/Makefile @@ -1,12 +1,26 @@ API_GOLANG_PATH:=../../05-example-web-application/api-golang/ +DOCKERHUB_REPO:=sidpalas/devops-directive-docker-course-api-golang N?=0 .PHONY: build-N build-N: - docker build --file ./Dockerfile.$(N) -t api-golang:$(N) ${API_GOLANG_PATH} + docker build --file ./Dockerfile.${N} \ + -t api-golang:${N} \ + -t ${DOCKERHUB_REPO}:${N} \ + ${API_GOLANG_PATH} .PHONY: build-all build-all: for number in 0 1 2 3 4 5 6 ; do \ N=$$number $(MAKE) build-N; \ - done \ No newline at end of file + done + +.PHONY: push-N +push-N: + docker push ${DOCKERHUB_REPO}:${N} + +.PHONY: push-all +push-all: + for number in 0 1 2 3 4 5 6 ; do \ + N=$$number $(MAKE) push-N; \ + done diff --git a/06-building-container-images/api-node/Makefile b/06-building-container-images/api-node/Makefile index 07f2e74..75d654f 100644 --- a/06-building-container-images/api-node/Makefile +++ b/06-building-container-images/api-node/Makefile @@ -1,12 +1,26 @@ API_NODE_PATH:=../../05-example-web-application/api-node/ +DOCKERHUB_REPO:=sidpalas/devops-directive-docker-course-api-node N?=0 .PHONY: build-N build-N: - docker build --file ./Dockerfile.$(N) -t api-node:$(N) ${API_NODE_PATH} + docker build --file ./Dockerfile.${N} \ + -t api-node:${N} \ + -t ${DOCKERHUB_REPO}:${N} \ + ${API_NODE_PATH} .PHONY: build-all build-all: for number in 0 1 2 3 4 5 6 7 ; do \ N=$$number $(MAKE) build-N; \ + done + +.PHONY: push-N +push-N: + docker push ${DOCKERHUB_REPO}:${N} + +.PHONY: push-all +push-all: + for number in 0 1 2 3 4 5 6 7; do \ + N=$$number $(MAKE) push-N; \ done \ No newline at end of file diff --git a/06-building-container-images/client-react/Makefile b/06-building-container-images/client-react/Makefile index eec16b6..1ad1b82 100644 --- a/06-building-container-images/client-react/Makefile +++ b/06-building-container-images/client-react/Makefile @@ -1,12 +1,26 @@ API_NODE_PATH:=../../05-example-web-application/client-react/ +DOCKERHUB_REPO:=sidpalas/devops-directive-docker-course-client-react-nginx N?=0 .PHONY: build-N build-N: - docker build --file ./Dockerfile.$(N) -t client-react:$(N) ${API_NODE_PATH} + docker build --file ./Dockerfile.${N} \ + -t client-react:${N} \ + -t ${DOCKERHUB_REPO}:${N} \ + ${API_NODE_PATH} .PHONY: build-all build-all: for number in 0 1 2 3 4 5; do \ N=$$number $(MAKE) build-N; \ - done \ No newline at end of file + done + +.PHONY: push-N +push-N: + docker push ${DOCKERHUB_REPO}:${N} + +.PHONY: push-all +push-all: + for number in 0 1 2 3 4 5; do \ + N=$$number $(MAKE) push-N; \ + done