localizer icon indicating copy to clipboard operation
localizer copied to clipboard

Error: container has runAsNonRoot and image will run as root

Open hirannair opened this issue 2 years ago • 6 comments

Im getting the below error while trying to run localizer

We have a PodSecurityPolicy set in our clusters - “RunasNonRootUser”

I think the pod is failing to run because it does not have any RunAsUser set.

Below are the errors.

NAME                                            READY   STATUS                       RESTARTS   AGE
localizer-finacle-limits-nch2w                  0/1     CreateContainerConfigError   0          106s
Events:
  Type     Reason     Age               From               Message
  ----     ------     ----              ----               -------
  Normal   Scheduled  54s               default-scheduler  Successfully assigned fin-acceptance/localizer-finacle-limits-nch2w
 to node-24
  Normal   Pulling    6s (x5 over 53s)  kubelet            Pulling image "linuxserver/openssh-server"
  Normal   Pulled     5s (x5 over 48s)  kubelet            Successfully pulled image "linuxserver/openssh-server"
  Warning  Failed     5s (x5 over 48s)  kubelet            Error: container has runAsNonRoot and image will run as root

hirannair avatar Jul 10 '21 04:07 hirannair

It'd be nice to have the images be ran as non-root. I'll see if I can get this added, but I can't give a firm timeline at the moment!

jaredallard avatar Jul 10 '21 04:07 jaredallard

Thanks @jaredallard

hirannair avatar Jul 10 '21 23:07 hirannair

@jaredallard Thanks for adding this as a feature.Can you please provide some instructions on how to get the build running locally.I have updated the code to run the pod as non root user in my fork,but not able to get the build working.

hirannair avatar Jul 13 '21 02:07 hirannair

@jaredallard Thanks for adding this as a feature.Can you please provide some instructions on how to get the build running locally.I have updated the code to run the pod as non root user in my fork,but not able to get the build working.

Should just be make, what are you running into?

jaredallard avatar Jul 13 '21 18:07 jaredallard

@jaredallard getting the below error

$ make
Error: open .versions.devbase: no such file or directory
Makefile:4: .bootstrap/root/Makefile: No such file or directory
make: *** No rule to make target '.bootstrap/root/Makefile'.  Stop.

hirannair avatar Jul 14 '21 02:07 hirannair

@jaredallard Ignore that.One of my colleague got it working.All good now

hirannair avatar Jul 14 '21 02:07 hirannair