Skip to content

Commit

Permalink
Run as root
Browse files Browse the repository at this point in the history
  • Loading branch information
jknipper committed Nov 19, 2024
1 parent 8580c04 commit 56d38a3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ RUN make -C /src install PREFIX=/pkg GOTOOLCHAIN=local GO_BUILDFLAGS='-mod vendo

FROM alpine:3.20

RUN addgroup -g 4200 appgroup \
&& adduser -h /home/appuser -s /sbin/nologin -G appgroup -D -u 4200 appuser

# upgrade all installed packages to fix potential CVEs in advance
# also remove apk package manager to hopefully remove dependency on OpenSSL 🤞
RUN apk upgrade --no-cache --no-progress \
Expand All @@ -31,6 +28,5 @@ LABEL source_repository="https://github.com/sapcc/kubernetes-oomkill-exporter" \
org.opencontainers.image.revision=${BININFO_COMMIT_HASH} \
org.opencontainers.image.version=${BININFO_VERSION}

USER 4200:4200
WORKDIR /home/appuser
WORKDIR /
ENTRYPOINT [ "/usr/bin/kubernetes-oomkill-exporter" ]
1 change: 1 addition & 0 deletions Makefile.maker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ binaries:
installTo: bin/
dockerfile:
enabled: true
runAsRoot: true
golang:
setGoModVersion: true
enableVendoring: true
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/sapcc/kubernetes-oomkill-exporter

go 1.23.1
go 1.23

toolchain go1.23.3

Expand Down

0 comments on commit 56d38a3

Please sign in to comment.