Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run as non-root and set security context #26

Merged
merged 1 commit into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/docs
/build
9 changes: 9 additions & 0 deletions build/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,13 @@ LABEL org.opencontainers.image.description="Lightweight, elastic, kubernetes-nat

WORKDIR /work/
COPY --from=builder /build/barco .

RUN mkdir /var/lib/barco

RUN chgrp -R 0 /var/lib/barco && \
chmod -R g=u /var/lib/barco && \
chown -R 1001:0 /var/lib/barco

USER 1001

CMD ["/work/barco"]
8 changes: 8 additions & 0 deletions deploy/kubernetes/barco.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ spec:
- name: barco
image: barcostreams/barco:dev1
imagePullPolicy: Always
securityContext:
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
allowPrivilegeEscalation: false
runAsNonRoot: true
ports:
- containerPort: 9250
name: discovery
Expand Down