Echo-Server icon indicating copy to clipboard operation
Echo-Server copied to clipboard

Run docker container as non privileged user (node with UID 1000?)

Open cbugneac-nex opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. At the moment docker image runs as root user which is not good from security perspective.

Describe the solution you'd like Run docker container at leas as built-in node user with UID 1000.

Describe alternatives you've considered Build custom image which is not great idea.

Additional context Want to run this image in K8s as non root.

cbugneac-nex avatar Apr 28 '23 07:04 cbugneac-nex

docker run -d -p 3000:80 --user 1000 ealen/echo-server:0.8.10 I tried to run the docker with user 1000, it worked, so I think it should also work in k8s, maybe like this

apiVersion: v1
kind: Pod
metadata:
  name: my-pod
spec:
  containers:
    - name: my-container
      image: my-image
      securityContext:
        runAsUser: 1000

locustbaby avatar Oct 21 '23 14:10 locustbaby