generated from ministryofjustice/analytical-platform-image-build-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
27 lines (21 loc) · 824 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
.PHONY: test build run scan ct
IMAGE_NAME ?= ghcr.io/ministryofjustice/analytical-platform-actions-runner
IMAGE_TAG ?= local
ct:
ct lint --charts chart
scan: build
trivy image --vuln-type os,library --severity CRITICAL --exit-code 1 $(IMAGE_NAME)
run: build
docker run --rm -it --entrypoint /bin/bash $(IMAGE_NAME):$(IMAGE_TAG)
test: build
container-structure-test test --platform linux/amd64 --config test/container-structure-test.yml --image $(IMAGE_NAME):$(IMAGE_TAG)
build:
@ARCH=`uname --machine`; \
case $$ARCH in \
aarch64 | arm64) \
echo "Building on $$ARCH architecture"; \
docker build --platform linux/amd64 --file Dockerfile --tag $(IMAGE_NAME):$(IMAGE_TAG) . ;; \
*) \
echo "Building on $$ARCH architecture"; \
docker build --file Dockerfile --tag $(IMAGE_NAME):$(IMAGE_TAG) . ;; \
esac