slate icon indicating copy to clipboard operation
slate copied to clipboard

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

Open mmaryo opened this issue 3 years ago • 3 comments

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?

mmaryo avatar Nov 30 '22 08:11 mmaryo

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.

HughPowell avatar Jan 12 '23 01:01 HughPowell

Closed

SetEst374 avatar May 26 '23 14:05 SetEst374

Closed restricted sites

SetEst374 avatar May 26 '23 14:05 SetEst374