-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (23 loc) · 1.32 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
VERSION=`git rev-parse HEAD`
BUILD=`date +%FT%T%z`
LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD}"
.PHONY: help
help: ## - Show help message
@printf "\033[32m\xE2\x9c\x93 usage: make [target]\n\n\033[0m"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: build
build: ## - Build the smallest and secured golang docker image based on scratch
@printf "\033[32m\xE2\x9c\x93 Build the smallest and secured golang docker image based on scratch\n\033[0m"
@docker build -f Dockerfile -t exchange-rates-server .
.PHONY: build-no-cache
build-no-cache: ## - Build the smallest and secured golang docker image based on scratch with no cache
@printf "\033[32m\xE2\x9c\x93 Build the smallest and secured golang docker image based on scratch\n\033[0m"
@docker build --no-cache -f Dockerfile -t exchange-rates-server .
.PHONY: ls
ls: ## - List 'exchange-rates-server' docker images
@printf "\033[32m\xE2\x9c\x93 Look at the size dude !\n\033[0m"
@docker image ls exchange-rates-server
.PHONY: run
run: ## - Run the smallest and secured golang docker image based on scratch
@printf "\033[32m\xE2\x9c\x93 Run the smallest and secured golang docker image based on scratch\n\033[0m"
@docker run -p 8000:8000 exchange-rates-server:latest