-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (39 loc) · 1.41 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
37
38
39
40
41
42
43
44
45
46
47
48
49
DOCKER_REGISTRY = index.docker.io
IMAGE_NAME = ca-certificates
IMAGE_VERSION = latest
IMAGE_ORG = scentregroup
IMAGE_TAG = $(DOCKER_REGISTRY)/$(IMAGE_ORG)/$(IMAGE_NAME):$(IMAGE_VERSION)
export DOCKER_BUILDKIT = 1
WORKING_DIR := $(shell pwd)
.DEFAULT_GOAL := docker-build
.PHONY: build push
docker-release:: docker-build docker-push ## builds and pushes the docker image to the registry
docker-push:: ## pushes the docker image to the registry
@docker push $(IMAGE_TAG)
docker-build:: ## builds the docker image locally
@echo http_proxy=$(HTTP_PROXY) http_proxy=$(HTTPS_PROXY)
@echo building $(IMAGE_TAG)
@docker build --pull \
--build-arg=http_proxy=$(HTTP_PROXY) \
--build-arg=https_proxy=$(HTTPS_PROXY) \
-t $(IMAGE_TAG) $(WORKING_DIR)
docker-run:: ## runs the docker image locally
@docker run \
-it \
$(DOCKER_REGISTRY)/$(IMAGE_ORG)/$(IMAGE_NAME):$(IMAGE_VERSION)
docker-test:: ## does a full build and test with docker
make docker-build
docker build -t ca-certificates-test -f Dockerfile.test .
docker run -it ca-certificates-test
# a help target including self-documenting targets (see the awk statement)
define HELP_TEXT
Usage: make [TARGET]... [MAKEVAR1=SOMETHING]...
Available targets:
endef
export HELP_TEXT
help: ## this help target
@cat .banner
@echo
@echo "$$HELP_TEXT"
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / \
{printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)