docker环境中wkhtmltopdf中的子进程错误

时间:2017-09-25 06:37:38

标签: django docker wkhtmltopdf django-wkhtmltopdf

当我尝试在docker环境中运行wkhtmltopdf时,获取以下错误。

server<- function(input,output) { Changes<- reactive({input$Changes}) Size<- reactive({input$Size}) Iterations<- reactive({input$Iterations}) df<- reactive({ df <- school_choice_function(Changes(), Size(), Iterations()) return(data.frame(df, stringsAsFactors = FALSE)) }) output$dframe <- renderTable({ df() }) }

代码如下所示。

它在Ubuntu 16.04流浪汉机器上工作。但是,当我将其移动到docker环境时,它会因上述错误而失败。起初我使用的是Python3.6图像然后改为Ubuntu 16.04图像,认为wkhtmltopdf可能需要更全面的Linux环境。但仍然没有运气。

subprocess.CalledProcessError: Command '['wkhtmltopdf', '--encoding', 'utf8', '--margin-top', '10', '--quiet', '/tmp/wkhtmltopdf85qv7fvc.html', '-']' died with <Signals.SIGABRT: 6>.

1 个答案:

答案 0 :(得分:2)

问题是wkhtmltopdf需要DISPLAY / Xserver。

使用openlabs/docker-wkhtmltopdf作为基本图片可以解决您的问题。