Skip to content

Commit

Permalink
feat: add Dockerfile for backfill-redis (#53)
Browse files Browse the repository at this point in the history
This commit adds a Dockerfile for building a `backfill-redis` image,
which should be used periodically to ensure that redis contains the
complete rekor log.

The patchfile is required due to this upstream issue:

sigstore#1685

Once that pull request has been merged, we'll need to remove the
patchfile from `main` but not from the `midstream-v1.2.2` branch unless
it is backported upstream.

/cherry-pick midstream-v1.2.2

Signed-off-by: Lance Ball <[email protected]>
  • Loading branch information
lance committed Sep 15, 2023
1 parent 8a0f23f commit 2083bb5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions redhat/overlays/Dockerfile.backfill-redis
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#Build stage
FROM registry.access.redhat.com/ubi9/go-toolset@sha256:52ab391730a63945f61d93e8c913db4cc7a96f200de909cd525e2632055d9fa6 AS build-env
USER root
RUN git config --global --add safe.directory /opt/app-root/src
COPY . .
RUN make backfill-redis

#Install stage
FROM registry.access.redhat.com/ubi9/go-toolset@sha256:52ab391730a63945f61d93e8c913db4cc7a96f200de909cd525e2632055d9fa6
COPY --from=build-env /opt/app-root/src/backfill-redis /usr/local/bin/backfill-redis
WORKDIR /opt/app-root/src/home

#ENTRYPOINT
ENTRYPOINT [ "backfill-redis" ]
13 changes: 13 additions & 0 deletions redhat/patches/0002-makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/Makefile b/Makefile
index 9c2467b..4904ad9 100644
--- a/Makefile
+++ b/Makefile
@@ -83,7 +83,7 @@ rekor-server: $(SRCS)
CGO_ENABLED=0 go build -trimpath -ldflags "$(SERVER_LDFLAGS)" -o rekor-server ./cmd/rekor-server

backfill-redis: $(SRCS)
- CGO_ENABLED=0 go build -trimpath -ldflags "$(SERVER_LDFLAGS)" -o rekor-server ./cmd/backfill-redis
+ CGO_ENABLED=0 go build -trimpath -ldflags "$(SERVER_LDFLAGS)" -o backfill-redis ./cmd/backfill-redis

test:
go test ./...

0 comments on commit 2083bb5

Please sign in to comment.