webtorrent / webtorrent-hybrid

WebTorrent (with WebRTC support in Node.js)
https://webtorrent.io
MIT License
518 stars 98 forks source link

docker container with webtorrent-hybrid? #17

Closed juanpabloaj closed 8 years ago

juanpabloaj commented 8 years ago

Install webtorrent-hybrid is not easy, why not create a docker container with this package installed ?

feross commented 8 years ago

I'm not very familiar with docker. I know that docker images can be huge, multi-GB file. I'd rather solve this with Electron which has perfect webrtc support.

Expect this to be fixed soon.

juanpabloaj commented 8 years ago

ok, I understand .

BTW, some docker base containers are very small like

https://github.com/gliderlabs/docker-alpine

retrohacker commented 8 years ago

Hey @juanpabloaj,

I created one for my own use you may find useful: https://hub.docker.com/r/wblankenship/webtorrent/

Built from

# wblankenship/webtorrent
#
# Contains webtorrent-hybrid in a stable envoriment
#
# wrtc is super touchy and fragile, this is an attempt to make running
# webtorrent on wrtc predicatable by containing it and all of its deps in
# a Docker image.
FROM nodesource/node:0.10

MAINTAINER william.jblankenship@gmail.com

# wrtc deps
RUN apt-get update \
  && apt-get install -y --force-yes --no-install-recommends \
        python2.7 \
        git-all \
        pkg-config \
        libncurses5-dev \
        libssl-dev \
        libnss3-dev \
        libexpat-dev \
 && rm -rf /var/lib/apt/lists/*;

# Install webtorrent-hybrid
RUN git clone --recursive https://github.com/feross/webtorrent-hybrid.git \
 && cd webtorrent-hybrid \
 && npm install \
 && npm link

# Serve files out of /srv to be a good linux citizen
RUN mkdir -p /srv/webtorrent
WORKDIR /srv/webtorrent

# Container is a drop-in replacement for webtorrent
ENTRYPOINT ["webtorrent-hybrid"]

# Default command to run
CMD ["-q","--verbose","seed","/srv/webtorrent"]
jobevers commented 8 years ago

I get a segmentation fault when I try using this image. Not right away, but letting the program run long enough (usually about five minutes), it will eventually seg fault.

feross commented 8 years ago

@jobevers This is a known issue with wrtc :(

jobevers commented 8 years ago

darn. okay. well, thanks for saving the the trouble of trying to see if I had something built wrong.

retrohacker commented 8 years ago

@jobevers yes, as @feross pointed out, it is a Known issue. Much sadness.

I experienced a related issue that I want to capture in this issue incase someone stumbles across it.

I was experiencing a segfault locally 100% of the time when a remote browser connected to webtorrent-hybrid. It was caused by not having the proper system dependencies installed for wrtc. I'm unsure which one was missing, but following the project's readme helped get me on track: https://github.com/js-platform/node-webrtc#prerequisites