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

Build with Docker should create a build folder with current owner user instead of root #1690

Open
mmaryo opened this issue Nov 30, 2022 · 3 comments

Comments

@mmaryo
Copy link

mmaryo commented Nov 30, 2022

Hello
Using this command line for build:

docker run --rm -it --name slate -v $(shell pwd)/build:/srv/slate/build -v $(shell pwd)/slate/source:/srv/slate/source slatedocs/slate build

The build folder is generated with the root owner
To delete it we need to use sudo
That is not nice for a CI/CD
Could you change the Dockerfile to generate the build folder with the current user as owner?

@HughPowell
Copy link

Hi mmaryo,

I used this blog post to solve a similar issue for me.
Basically add the following option to the docker command
-u $(id -u ${USER}):$(id -g ${USER})
So in your case

docker run --rm -it --name slate -u $(id -u ${USER}):$(id -g ${USER}) -v (shell pwd)/slate/source:/srv/slate/source slatedocs/slate build

should work.

@SetEst374
Copy link

Closed

@SetEst374
Copy link

Closed restricted sites

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

3 participants