-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile.docker
39 lines (27 loc) · 878 Bytes
/
Makefile.docker
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
IMAGE := "garethr/snyky"
NAME := "snyky"
BUILD = docker build
default: test
check-buildkit:
ifndef DOCKER_BUILDKIT
$(error You must enable Buildkit for Docker, by setting DOCKER_BUILDKIT=1)
endif
check-snyk-token:
ifndef SNYK_TOKEN
$(error You must have a SNYK_TOKEN to enable the snyk tasks1)
endif
build: check-buildkit
@$(BUILD) -t $(IMAGE) .
slim: check-buildkit
@$(BUILD) --build-arg IMAGE=python:slim -t $(IMAGE):slim .
alpine: check-buildkit
@$(BUILD) --build-arg DISTRO=alpine --build-arg IMAGE=python:3.7-alpine3.8 -t $(IMAGE):alpine .
distroless: check-buildkit
@$(BUILD) --target Distroless -t $(IMAGE):distroless .
test: check-buildkit
@$(BUILD) --target Test .
snyk: check-buildkit check-snyk-token
@$(BUILD) --build-arg SNYK_TOKEN --target Security .
policy:
@$(BUILD) --target Policy .
.PHONY: build slim alpine distroless test snyk policy