Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
WebTorrent Hybrid Container example
FROM node
RUN apt-get update && \
apt-get install -y xvfb libgtk2.0-0 libxtst-dev libxss-dev libgconf2-dev \
libnss3 libasound2-dev && \
apt-get clean
RUN npm install webtorrent-hybrid -g
RUN mkdir work
WORKDIR work
CMD webtorrent-hybrid download \
e14cef00945a8d99dc74d65cf52dcb892cf48ed1 \
b7c88cda2ff91fd38abc98d191ed39c79a0a4003 \
--keep-seeding
Owner

ohac commented Oct 8, 2016

docker build -t webtorrent .
docker run -d --net=host webtorrent

Been having trouble with Electron

root@9f1b35fe6db5:/app# webtorrent-hybrid
/usr/local/lib/node_modules/webtorrent-hybrid/node_modules/electron/index.js:9
  throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
  ^

Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
    at Object.<anonymous> (/usr/local/lib/node_modules/webtorrent-hybrid/node_modules/electron/index.js:9:9)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/webtorrent-hybrid/node_modules/electron-eval/lib/index.js:13:16)
    at Module._compile (module.js:660:30)

Apparently Electron doesn't run well inside of Docker containers. electron/electron#11175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment