diff --git a/gitleaks/Dockerfile b/gitleaks/Dockerfile new file mode 100644 index 0000000..868531f --- /dev/null +++ b/gitleaks/Dockerfile @@ -0,0 +1,8 @@ +# Kind of sad that I need to make this trivial image. But the gitleaks docker +# image by default uses a user named `gitleaks` with uid 1000, and it doesn't +# work correctly unless the gitleaks is run with the user that owns the files +# in the repo. And in my CI (woodpecker) the files in the repo are owned by +# root and I can't configure the user running the container in its yaml config. +# So yeah... +FROM zricethezav/gitleaks +USER root diff --git a/gitleaks/Makefile b/gitleaks/Makefile new file mode 100644 index 0000000..6873574 --- /dev/null +++ b/gitleaks/Makefile @@ -0,0 +1,24 @@ +IMG_NAME=gitleaks +REGISTRY=registry.monotremata.xyz +IMG=$(REGISTRY)/$(IMG_NAME) +PLATFORMS=linux/amd64,linux/arm64 + +.PHONY: push buildx clean + +out/image-id: Dockerfile + mkdir -p $(@D) + docker build -t $(IMG) . + echo $(IMG) > $@ + +push: out/image-id + docker image push $(IMG) + +buildx: Dockerfile + docker buildx build \ + --platform $(PLATFORMS) \ + --tag $(IMG) \ + --push \ + . + +clean: + rm -rf out