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

[BUG] Docker build outputting root:root directory/file permissions #647

Open
mtraynham opened this issue Jun 3, 2022 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@mtraynham
Copy link

⚠️ Important Notice

Please differentiate the bug

This repository is not responsible for the actual code generation. If you have problems with the code generation, please open the bug at OpenAPITools/openapi-generator.

Please also check if the bug is already known before you open a new bug.


🐛 Bug Report:

Describe the bug

Docker image generates directory/files with root:root permissions instead of the current user.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Run the build using a docker image

Expected behavior

It generates the build using the current user and group.

Screenshots

image

Operation System (please complete the following information):

  • OS: Ubuntu

Package System (please complete the following information):

  • Version [e.g. 22]

Additional context

Probably needs an additional Docker parameter when running the build to specify the user and group. https://docs.docker.com/engine/reference/run/#user

docker run --user $(id -u):$(id -g)
@mtraynham mtraynham added the bug Something isn't working label Jun 3, 2022
adnbrownie added a commit to adnbrownie/openapi-generator-cli that referenced this issue Jun 22, 2022
Running docker containers as root is considered a security issue. Fixes OpenAPITools#647.
@Papooch
Copy link

Papooch commented Jan 24, 2023

Thank you! This solved our problem where we couldn't revert changes in git for files generated by the openapi-generator docker image.

@kasir-barati
Copy link

Facing same issue, did this issue has been addressed or it is still an in-progress issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants