Skip to content

Commit c39b1ba

Browse files
authored
fix: adding nonRootUser initialization to dockerfiles (#506)
## Summary by Sourcery Enhancements: - Remove `USER root` statements from Dockerfiles of backfill-redis, rekor-cli, and rekor-server. --------- Signed-off-by: SequeI <[email protected]>
1 parent 0b5286a commit c39b1ba

9 files changed

+14
-7
lines changed

.tekton/backfill-redis-pull-request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ spec:
6161
stepSpecs:
6262
- computeResources:
6363
limits:
64-
memory: 3Gi
64+
memory: 5Gi
6565
name: run-tests
6666
taskRunTemplate:
6767
serviceAccountName: build-pipeline-backfill-redis

.tekton/backfill-redis-push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ spec:
5959
stepSpecs:
6060
- computeResources:
6161
limits:
62-
memory: 3Gi
62+
memory: 5Gi
6363
name: run-tests
6464
taskRunTemplate:
6565
serviceAccountName: build-pipeline-backfill-redis

.tekton/rekor-cli-pull-request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ spec:
6161
stepSpecs:
6262
- computeResources:
6363
limits:
64-
memory: 3Gi
64+
memory: 5Gi
6565
name: run-tests
6666
taskRunTemplate:
6767
serviceAccountName: build-pipeline-rekor-cli

.tekton/rekor-cli-push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ spec:
5858
stepSpecs:
5959
- computeResources:
6060
limits:
61-
memory: 3Gi
61+
memory: 5Gi
6262
name: run-tests
6363
taskRunTemplate:
6464
serviceAccountName: build-pipeline-rekor-cli

.tekton/rekor-server-pull-request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ spec:
6161
stepSpecs:
6262
- computeResources:
6363
limits:
64-
memory: 3Gi
64+
memory: 5Gi
6565
name: run-tests
6666
taskRunTemplate:
6767
serviceAccountName: build-pipeline-rekor-server

.tekton/rekor-server-push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ spec:
5959
stepSpecs:
6060
- computeResources:
6161
limits:
62-
memory: 3Gi
62+
memory: 5Gi
6363
name: run-tests
6464
taskRunTemplate:
6565
serviceAccountName: build-pipeline-rekor-server

Dockerfile.backfill-redis.rh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RUN go build -mod=readonly -trimpath -ldflags "$(SERVER_LDFLAGS)" -o backfill-re
2020
# Install stage
2121
FROM registry.redhat.io/rhel9/redis-6@sha256:0962d18bb5292c0e524354f319b63287c2298a4a2fd34556c68fa285df381427
2222
COPY --from=build-env /opt/app-root/src/backfill-redis /usr/local/bin/backfill-redis
23+
COPY LICENSE /licenses/license.txt
2324
WORKDIR /opt/app-root/src/home
2425

2526
LABEL description="Backfillredis is a job that will go through the TLog and make sure that missing entries are added to the search index."
@@ -30,5 +31,7 @@ LABEL summary="Provides the backfill-redis binary for a rekor server"
3031
LABEL com.redhat.component="backfill-redis"
3132
LABEL name="rhtas/rekor-backfill-redis-rhel9"
3233

34+
USER 65532:65532
35+
3336
#ENTRYPOINT
3437
ENTRYPOINT [ "backfill-redis" ]

Dockerfile.rekor-cli.rh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ COPY --from=build-env /opt/app-root/src/rekor_cli_linux_arm64.gz /usr/local/bin/
4848
COPY --from=build-env /opt/app-root/src/rekor_cli_linux_ppc64le.gz /usr/local/bin/rekor_cli_linux_ppc64le.gz
4949
COPY --from=build-env /opt/app-root/src/rekor_cli_linux_s390x.gz /usr/local/bin/rekor_cli_linux_s390x.gz
5050
COPY --from=build-env /opt/app-root/src/rekor_cli_windows_amd64.exe.gz /usr/local/bin/rekor_cli_windows_amd64.exe.gz
51+
COPY LICENSE /licenses/license.txt
5152
WORKDIR /opt/app-root/src/home
5253

53-
54+
USER 65532:65532

Dockerfile.rekor-server.rh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ LABEL name="rhtas/rekor-server-rhel9"
7373

7474
# Retrieve the binary from the previous stage
7575
COPY --from=build-env /opt/app-root/src/rekor-server /usr/local/bin/rekor-server
76+
COPY LICENSE /licenses/license.txt
77+
78+
USER 65532:65532
7679

7780
# Set the binary as the entrypoint of the container
7881
ENTRYPOINT ["rekor-server"]

0 commit comments

Comments
 (0)