Skip to content

Commit

Permalink
images: Run as non-root
Browse files Browse the repository at this point in the history
The pod was already enforcing the container to run as non-root, but the
container itself was still run as the root user (with uid 0). Now the
containers are explicitly run with a different user id, which meets the
pod's security constrtaints.

Fixes kubevirt#389

Signed-off-by: Fabian Deutsch <[email protected]>
  • Loading branch information
fabiand committed Aug 28, 2017
1 parent afd24fb commit 5e60465
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion images/haproxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ RUN cp /docker-entrypoint.sh /docker-entrypoint-orig.sh
COPY docker-entrypoint.sh /docker-entrypoint.sh

RUN addgroup -S haproxy && adduser -S -D -h /haproxy -s /bin/false -G haproxy -g haproxy haproxy
#USER haproxy

RUN mkdir /haproxy/run && \
chgrp -R 0 /haproxy/run && \
chmod -R g=u /haproxy/run

USER 1001
2 changes: 2 additions & 0 deletions images/spice-proxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ RUN mkdir /home/proxy/run && \
chgrp -R 0 /home/proxy/run && \
chmod -R g=u /home/proxy/run

USER 1001

CMD squid -NCd1 -f /home/proxy/squid.conf

0 comments on commit 5e60465

Please sign in to comment.