-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (30 loc) · 961 Bytes
/
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
repository = toolen/passgen-web-client
version = $(shell npm run version | tail -1)
image_tag = ghcr.io/$(repository):$(version)
hadolint_version=2.12.0
trivy_version=0.48.1
image:
make hadolint
docker build --pull --no-cache -t $(image_tag) .
make trivy
make size
container:
docker run -p 8080:80 --cap-drop=ALL --cap-add CAP_CHOWN --cap-add CAP_NET_BIND_SERVICE --cap-add CAP_SETGID --cap-add CAP_SETUID $(image_tag)
hadolint:
docker run --rm -i hadolint/hadolint:$(hadolint_version) < Dockerfile
trivy:
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v ~/.cache/trivy:/root/.cache/ aquasec/trivy:$(trivy_version) image --ignore-unfixed $(image_tag)
size:
docker images | grep $(repository) | grep $(version)
scan:
trivy image $(image_tag)
push:
docker trust sign $(image_tag)
push-to-ghcr:
docker login ghcr.io -u toolen -p $(CR_PAT)
docker push $(image_tag)
ci:
npm install
npm install -g @lhci/cli
npm run build
lhci autorun