-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
46 lines (35 loc) · 1.33 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
IMAGE?=khulnasoft/vul-docker-extension
TAG?=latest
BUILDER=buildx-multi-arch
STATIC_FLAGS=CGO_ENABLED=0
LDFLAGS="-s -w"
GO_BUILD=$(STATIC_FLAGS) go build -trimpath -ldflags=$(LDFLAGS)
.PHONY: bin
bin: ## Build the binary for the current plarform
@echo "$(INFO_COLOR)Building...$(NO_COLOR)"
$(GO_BUILD) -o bin/creds-service ./service
.PHONY: build-app
build-app:
@npm run-script build
.PHONY: build-dev
build-dev:
@DOCKER_BUILDKIT=1 docker build -t vul-docker-extension:development .
.PHONY: deploy-dev
deploy-dev: build-dev
@docker extension rm vul-docker-extension:development || true
@docker extension install vul-docker-extension:development
.PHONY: dev-debug
dev-debug:
@docker extension dev debug vul-docker-extension:development
.PHONY: dev-reset
dev-reset:
@docker extension dev reset vul-docker-extension:development
.PHONY: remove-dev
remove-dev:
@docker extension rm vul-docker-extension:development || true
.PHONY: prepare-buildx
prepare-buildx: ## Create buildx builder for multi-arch build, if not exists
docker buildx inspect $(BUILDER) || docker buildx create --name=$(BUILDER) --driver=docker-container --driver-opt=network=host
.PHONY: release-extension
release-extension: prepare-buildx
@docker buildx build --push --builder=$(BUILDER) --platform=linux/amd64,linux/arm64 --build-arg TAG=$(TAG) --tag=$(IMAGE):$(TAG) .