gitleaks image

Ricard Illa 2022-08-24 11:59:29 +02:00
parent fc4acc71c1
commit c1554f21b5
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
2 changed files with 32 additions and 0 deletions

8
gitleaks/Dockerfile Normal file
View File

@ -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

24
gitleaks/Makefile Normal file
View File

@ -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