diff options
author | Cody Hiar <codyfh@gmail.com> | 2018-11-12 19:19:50 +0000 |
---|---|---|
committer | Cody Hiar <codyfh@gmail.com> | 2018-11-12 19:19:50 +0000 |
commit | 7686d0ca2e637fd004e4f716f0ba10bbf9a24b88 (patch) | |
tree | e1ea89197e727d6e5462f9f8e52aa1271882f9cd /Makefile | |
parent | c14a85a4eec42178469b5f410d7e4c133431fa52 (diff) |
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2d5833e --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +.PHONY: build + +CONTAINERNAME=thornycrackers_helloworld +IMAGENAME=thornycrackers/helloworld + +help: + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +build: ## Build the image + docker build -t $(IMAGENAME) . + +up: build ## Run the container + docker run -dP --name $(CONTAINERNAME) $(IMAGENAME) + +down: ## Stop the container + docker stop $(CONTAINERNAME) 2> /dev/null || echo 'No container to stop' + +clean: down ## Remove the container + docker rm $(CONTAINERNAME) 2> /dev/null || echo 'No container to remove' + +push: ## Push the container to dockerhub + docker push $(IMAGENAME) |