Vauxoo / travis2docker

This is a Library to transform travis to docker file
BSD 2-Clause "Simplified" License
13 stars 15 forks source link

Advice that directory /home/odoo/.cache Needs permission update #186

Closed hbto closed 1 year ago

hbto commented 1 year ago

When first running pre-commit-vauxoo

It tries to create new folders at directory /home/odoo/.cache/

But in doing so an Exception is raised:


PermissionError: [Errno 13] Permission denied: '/home/odoo/.cache/

Screenshot 2022-10-28 at 3 07 13

Changing ownership on folder from root to odoo is needed

chown -R odoo:odoo /home/odoo/.cache/ 

as directory is owned by root: Screenshot 2022-10-28 at 3 11 14

It would be good to have this advice when running t2d


docker exec -it --user=root CONTAINER chown -R odoo:odoo /home/odoo/.cache/ 

Regards.

moylop260 commented 1 year ago

@antonag32

This folder can be changed during the image build since it is not a volume (I think so)

Could you check what particular folders or files in the /home/odoo path has root permissions in order to run chown from the Dockerfile, please?

e.g. chown -R odoo:odoo /home/odoo/.config from https://github.com/Vauxoo/travis2docker/issues/172

and chown -R odoo:odoo /home/odoo/.cache

Also, the following path is missing in the PATH /home/odoo/.local/bin

moylop260 commented 1 year ago

BTW Maybe something is not working well here:

Notice we don't like to run chown -R odoo:odoo /home/odoo/ because of it spends a lot of time and almost of the path already have odoo permission

luisg123v commented 1 year ago

FYI @allanpa88

antonag32 commented 1 year ago

@moylop260

I don't think we can place it in the Dockerfile since these folders are not part of the base install, but are generated by optional programs, like vim.

In this case .cache being owned by root is caused by choosing installing the ctrpl plugin for vim. /home/odoo/.spf13-vim-3 is also owned by root but I don't think that causes any problems.

I also could not find /home/odoo/.config, on the images I created. What program is using that directory?

moylop260 commented 1 year ago

You can use a find with not user

moylop260 commented 1 year ago

FYI $HOME/.cache is a generic folder used from pre-commit, pip and so on