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

Using random user id while running function containers #152

Open
zeerorg opened this issue Jun 3, 2019 · 3 comments
Open

Using random user id while running function containers #152

zeerorg opened this issue Jun 3, 2019 · 3 comments

Comments

@zeerorg
Copy link
Contributor

zeerorg commented Jun 3, 2019

Update on node js, c# and golang templates to allow running containers with random uid. This makes them compatible with OpenShift.

Context

This issue was noted with Python templates and fixed in #145
I tried to reproduce this issue with 3 templates: nodejs, c# and golang but this issue doesn't affect them and hence there is no need for any change.

How this was tested:

This was tested with the basic idea given in #145 by creating a function from the specific template which uses some external library, building the function and running the docker container with --user <random id>:0

  1. NodeJS: MomentJS was used
  2. C#: NewtonSoft was used
  3. Golang: Now was used

Another testing was done by creating a test.txt file in the function folder and building the function again to check if different UID causes any isssues with reading files and no issue was observed for all 3 templates including Python.

@alexellis
Copy link
Member

@zeerorg
Copy link
Contributor Author

zeerorg commented Jun 3, 2019

I'll test with those and revert back.

@zeerorg
Copy link
Contributor Author

zeerorg commented Jun 5, 2019

The java and golang-http templates have no issues running on different users. But the python3-debian and python-flask templates both have user set as root and hence can't run on different users. They both need to be updated.

Error reported: docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "chdir to cwd (\"/root\") set in config.json failed: permission denied": unknown

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

2 participants