-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.ndn
90 lines (74 loc) · 2.34 KB
/
Dockerfile.ndn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
FROM node:8
RUN echo 'deb http://deb.debian.org/debian stretch non-free contrib' > /etc/apt/sources.list.d/contrib.list
WORKDIR /usr/src/app
COPY video /usr/src/app/video
COPY streaming-ndn.js /usr/src/app
#COPY publish.sh /usr/src/app
ENV IPFS_WRTC_LINUX_WINDOWS=1
ENV IPFS_MONITORING=1
ENV IPFS_PATH=/root/.jsipfs
ENV IPFS_API_HOST=0.0.0.0
ENV BUILD_DEPS='libnspr4 libnspr4-dev libnss3'
EXPOSE 4002
EXPOSE 4003
EXPOSE 5002
EXPOSE 9090
RUN apt-get update \
&& apt-get install --yes $BUILD_DEPS \
&& apt-get install --yes libpcap-dev libboost-all-dev \
&& rm -rf /var/lib/apt/lists/* \
&& npm install --production \
&& npm install wrtc@0.0.67 --production \
&& npm install m3u8 \
&& npm install ipfs \
&& npm install fs log-timestamp \
&& npm cache clear --force \
&& apt-get purge --yes $BUILD_DEPS libpcap-dev libboost-all-dev \
&& rm -rf /usr/share/doc /usr/share/locale \
&& rm -rf /usr/local/share/.cache \
&& rm -rf node_modules/go-ipfs-dep/go-ipfs/ipfs
# && ln -s $(pwd)/src/cli/bin.js /usr/local/bin/jsipfs
# install ndn-cxx
RUN git clone https://github.com/named-data/ndn-cxx.git \
&& cd ndn-cxx \
# && git checkout $VERSION_CXX \
&& ./waf configure \
&& ./waf \
&& ./waf install \
&& cd .. \
# && rm -Rf ndn-cxx \
&& ldconfig
# install NFD
RUN git clone --recursive https://github.com/named-data/NFD \
&& cd NFD \
# && git checkout $VERSION_NFD \
&& ./waf configure \
&& ./waf \
&& ./waf install \
&& cd ..
# && rm -Rf NFD
# install ndn-tools
RUN git clone --recursive https://github.com/named-data/ndn-tools.git \
&& cd ndn-tools \
&& ./waf configure --disable-dissect \
&& ./waf \
&& ./waf install \
&& cd .. \
&& rm -Rf ndn-tools
# initial configuration
RUN cp /usr/local/etc/ndn/nfd.conf.sample /usr/local/etc/ndn/nfd.conf \
&& ndnsec-keygen /`whoami` | ndnsec-install-cert - \
&& mkdir -p /usr/local/etc/ndn/keys \
&& ndnsec-cert-dump -i /`whoami` > default.ndncert \
&& mv default.ndncert /usr/local/etc/ndn/keys/default.ndncert
RUN mkdir /share \
&& mkdir /logs
# cleanup
#RUN apt autoremove \
# && apt-get remove -y git build-essential python pkg-config
EXPOSE 6363/tcp
EXPOSE 6363/udp
ENV CONFIG=/usr/local/etc/ndn/nfd.conf
ENV LOG_FILE=/logs/nfd.log
CMD /usr/local/bin/nfd -c $CONFIG > $LOG_FILE 2>&1
#CMD node --harmony streaming.js