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

Make it possible to run container as nonRootUser #87

Open
sleccese opened this issue Oct 18, 2021 · 0 comments
Open

Make it possible to run container as nonRootUser #87

sleccese opened this issue Oct 18, 2021 · 0 comments

Comments

@sleccese
Copy link

Hi,
I have the constrains to run images with nonRootUser.
I tried to set the securityContext in my Deployment.yaml as following:

kind: Deployment
....
spec:
  template:
    spec:
      securityContext:
        nonRootUser: true
        fsGroup: 1000
        runAsUser: 1000

However, as I started the image I found out that in the default entrypoint and default CMD there is sudo required which will not work with nonRootUser. I am not to fimilar with PHP and PHP-FPM so I do not know if it is possible to remove this sudo parts.

Following lines in the php base image are in my opinion the problem:
399 ENTRYPOINT ["/docker-entrypoint.sh"]
400 CMD ["sudo", "-E", "LD_PRELOAD=/usr/lib/preloadable_libiconv.so", "php-fpm"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant