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 docker container as a non-root user #352

Open
andrej98 opened this issue Jan 23, 2023 · 0 comments
Open

Run docker container as a non-root user #352

andrej98 opened this issue Jan 23, 2023 · 0 comments

Comments

@andrej98
Copy link

andrej98 commented Jan 23, 2023

Hello,
Some kubernetes cluster providers do not allow to run the container as a root user because of security reasons. So you need to specify spec.template.spec.securityContext.runAsUser: <USERID> in your deployment resource.

However, design of Concerto docker image does not allow this, because in the CMD section there are many commands that require root user.

To allow this, the docker image should be built in a way that all the commands that require root user are executed in the build of the docker image and commands in the CMD can be executed with another user.

Concerto Platform version

5.0.27 and master

Expected behavior

Application normally deploys on Kubernetes cluster with spec.template.spec.securityContext.runAsUser: <USERID> specified in the deployment resource.

Actual behavior

Pods do not start, because commands in the CMD section fail. Log: /bin/sh: 1: cannot create /root/env.sh: Permission denied

Steps to reproduce the issue

Option 1. Put spec.template.spec.securityContext.runAsUser: <USERID> in the kubernetes deployment resource.
Option 2. Put USER <USERID> in the Dockerfile before the CMD section.

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