-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
36 lines (28 loc) · 1.17 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
29
30
31
32
33
34
35
36
.PHONY: default
default: help;
STACK_SLUG := chucknorrisio/postgres
STACK_VERSION := 9.6.13
help: ## Show this help
@echo '----------------------------------------------------------------------'
@echo $(STACK_SLUG)
@echo '----------------------------------------------------------------------'
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
@echo '----------------------------------------------------------------------'
build: ## Build the container
@docker build \
--file Dockerfile \
--tag "${STACK_SLUG}:${STACK_VERSION}" .
connect: ## Start an interactive psql session
@docker exec -it "chucknorris-postgres" psql chuck -h localhost -U postgres
destroy: ## Delete the image
@docker rmi "${STACK_SLUG}"
release: ## Push image to docker registry
@docker push "${STACK_SLUG}:${STACK_VERSION}"
run: ## Run the container
@docker run -d \
-p '5432:5432' \
--name "chucknorris-postgres" \
"${STACK_SLUG}:${STACK_VERSION}"
stop: ## Stop and remove the container
@docker kill "chucknorris-postgres"
@docker rm "chucknorris-postgres"