nstrayer / datadrivencv

R package for building customizable CVs from spreadsheets
http://nickstrayer.me/datadrivencv/
Other
594 stars 178 forks source link

Can't produce pdf output inside a docker container #50

Open BerriJ opened 3 years ago

BerriJ commented 3 years ago

I'm using docker for all of my projects now. Especially for a CV it seems relevant to use a reproducible environment because you usually need to update your cv seldom and large time gaps are in between the updates. However, I'm a root user inside that docker container and you can't run headless chromium as root without the --no-sandbox flag (see https://github.com/rstudio/pagedown/issues/143).

That is, I suggest adding extra_args = "--no-sandbox" to render_cv.r line 22. I'll make a PR for that in a moment. I think this option shouldn't hurt anyone running R and Chrome locally but It will prevent a struggle for people heavily utilizing docker.

# Convert to PDF using Pagedown
pagedown::chrome_print(
    input = tmp_html_cv_loc,
    output = "cv.pdf",
    extra_args = "--no-sandbox"
)