Is it possible to run xvfb on Heroku?

僤鯓⒐⒋嵵緔 提交于 2019-12-05 06:35:36

I found this question while researching how to update Xvfb for Cedar-14, and I managed to get #2 to work. So here's how:

  1. I used buildpack-apt to install x11-xkb-utils xvfb x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic libxfont1 xvfb.

  2. After running the apt buildpack, you need to patch Xvfb a bit to make everything work smoothly. For that, I used my own run-bash buildpack, but everything that lets you run a bash script during Heroku compile will work. Here's the script I used to patch Xvfb and index the fonts: https://gist.github.com/fxtentacle/960cdb96ece01add8686

  3. Now you can use heroku run bash to check with XAUTHORITY=/tmp/xvfb-run.2NG0xl/Xauthority Xvfb ":99" -screen 0 1280x1024x24 -nolisten tcp that the Xvfb is working.

Yes, it is possible, but complicated. I followed some of what fxtentacle did (in their answer), but this may be simpler. These instructions provide for a minimal Xvfb setup; it still prints out a bunch of warnings.

Use heroku-buildpack-apt to install the xvfb and libnotify4 debian packages. Then use this buildpack to fix the /usr/bin/xkbcomp issue: https://github.com/captain401/heroku-buildpack-xvfb

Then you can use xvfb-run $PROGRAM to run your application.

I'm wondering the same thing. Seems like you already found this guy's issue. All the buildpacks mentioned are 1+ years old, and don't work anymore.

Two viable seeming options:

  1. Compile a self-contained xvfb binary a la https://github.com/kenshin23/xvfb-portable-binary that runs on Heroku's current OS and architecture, rebuild when they update.

  2. Install all dependencies from the apt package manager into someplace like ~/.apt, and run from there, as in the latest buildpack-apt. For me, this option dies with sh: 1: /usr/bin/xkbcomp: not found. Xvfb is looking in /, while apt installed the command to ~/.apt/usr/bin/xkbcomp. Haven't figured out how to tell Xvfb to look in ~/.apt/.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!