Docker non root container permission denied for the first run binary extraction
Hello and thank you for the great application.
I have an interesting situation with a non-root docker container. When I use non-root container (user in a container not have root access) i get error:
Command Error: /usr/local/bundle/gems/wkhtmltopdf-binary-0.12.6.5/bin/wkhtmltopdf:55:in initialize': Permission denied @ rb_sysopen - /usr/local/bundle/gems/wkhtmltopdf-binary-0.12.6.5/bin/wkhtmltopdf_debian_10_amd64 (Errno::EACCES) from /usr/local/bundle/gems/wkhtmltopdf-binary-0.12.6.5/bin/wkhtmltopdf:55:in open'
As a workaround, I can use gunzip in Dockerfile or set write permissions for my user for bin directory, but maybe we need to add this into the documentation as a note or use binary without compress.
Hey @yoleksandr
Can you share your soluction, please?
This is how I fixed it on my Dockerfile:
RUN chmod -R 777 $(rvm-exec gemdir)/gems/wkhtmltopdf-binary-0.12.6.5/bin
RUN ln -s $(rvm-exec gemdir)/bin/wkhtmltopdf /usr/bin
Make sure to replace 0.12.6.5 with your version listed on your Gemfile.lock