cdrx / docker-pyinstaller

PyInstaller for Linux and Windows inside Docker
MIT License
616 stars 238 forks source link

Files and folders owned by root on exit. #123

Open einarjon opened 10 months ago

einarjon commented 10 months ago

After running the pyinstaller, both entrypoints fix the permissions by running chown -R --reference=. ./dist/linux and chown -R --reference=. ./dist/windows That's usually not enough, and it leaves files/folders with root ownership.

So I have to run docker run -v $PWD/win:/src cdrx/pyinstaller-windows:python3 'chown -R --reference=/src /src' to clean that up every time.

Proposed fix: Change line 42 of the entrypoint files to chown -R --reference=. ./dist ./__pycache__ https://github.com/cdrx/docker-pyinstaller/blob/master/entrypoint-linux.sh#L42 https://github.com/cdrx/docker-pyinstaller/blob/master/entrypoint-windows.sh#L42

Steps to reproduce:

$ docker run -v  $PWD/lin:/src   cdrx/pyinstaller-linux:python3 >& /dev/null
$ find lin -user  0  -exec ls -ld {} \;
drwxr-xr-x. 3 root root 4096 Nov 10 14:37 lin/dist
drwxr-xr-x. 2 root root 4096 Nov 10 14:37 lin/__pycache__
-rw-r--r--. 1 root root 3141 Nov 10 14:37 lin/__pycache__/myexecutable.cpython-37.pyc
$ docker run -v  $PWD/win:/src   cdrx/pyinstaller-windows:python3 >& /dev/null
$ find win -user  0  -exec ls -ld {} \;
drwxr-xr-x. 3 root root 4096 Nov 10 14:42 win/dist
drwxr-xr-x. 2 root root 4096 Nov 10 14:42 win/__pycache__
-rw-r--r--. 1 root root 3143 Nov 10 14:42 win/__pycache__/myexecutable.cpython-37.pyc