Rudloff / alltube

Web GUI for youtube-dl
GNU General Public License v3.0
2.94k stars 585 forks source link

Fix dockerfile templates_c/ permission issue #426

Closed samueltan3972 closed 1 year ago

samueltan3972 commented 1 year ago

Fix the error with permission issue in /var/www/html/templates_c/ folder when building docker image

boombatower commented 1 year ago
 > [13/13] RUN chmod 770 -R /var/www/html/templates_c/:
cannot access '/var/www/html/templates_c/': No such file or directory

https://gitlab.com/boombatower-container/alltube/-/jobs/3281480936

Rudloff commented 1 year ago

That's strange, the folder does exist here and should have been copied by COPY. But maybe I'm missing something. (I don't really maintain the Docker image anymore and leave it up to the community.)

Rudloff commented 1 year ago

@boombatower I could reproduce your error. The problem is that templates_c is in .dockerignore (so we don't accidentally add compiled templates to the image). This should fix it: https://github.com/Rudloff/alltube/commit/f32412e861c88e987131d62ab812156b1702cecf

maxemoose commented 1 year ago

Just a heads-up: I was building this Docker image on a Synology NAS and the process was still failing at step 13. Error was as follows:

mkdir: cannot create directory '/var/www/html/templates_c/': File exists

Fixed by adding "-p" to the command mentioned in f32412e so that it becomes:

RUN mkdir -p /var/www/html/templates_c/

Rudloff commented 1 year ago

@maxemoose Would you like to submit a PR with this fix?

maxemoose commented 1 year ago

@Rudloff Can do. To follow.

Turned out I had another issue with that build though; The permissions set by step 14: RUN chmod 770 -R /var/www/html/templates_c/

The addition of "-p" to step 13 allowed the image to compile but running it Alltube could not show the web interface. Logs showed the following: Smarty: unable to write file /var/www/html/templates_c/wrt636.....

Had to adjust step 14 to permissions 777 before Alltube could show the web interface again. Not an ideal solution but it will do until I can determine a better one.