From c1554f21b5fa0c69fff7864dad23935c05b50f42 Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Wed, 24 Aug 2022 11:59:29 +0200 Subject: [PATCH] gitleaks image --- gitleaks/Dockerfile | 8 ++++++++ gitleaks/Makefile | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 gitleaks/Dockerfile create mode 100644 gitleaks/Makefile 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