-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
86 lines (72 loc) · 2.36 KB
/
Dockerfile
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
FROM ubuntu:14.04
MAINTAINER Surya Nimmagadda <nscsekhar@juniper.net> && Abbas Sakarwala <abbas@juniper.net>
# Install base packages
RUN cd /home \
&& sudo apt-get update \
&& sudo apt-get install -y git wget curl zip unzip \
&& sudo apt-get install -y build-essential autoconf libtool \
&& apt-get install -y python \
&& apt-get install -y python-setuptools
# Install GRPC and GPB
RUN cd /home \
&& git clone -b release-0_11 https://github.com/grpc/grpc grpc \
&& cd /home/grpc \
&& git submodule update --init \
&& make \
&& make install \
&& cd /home/grpc/third_party/protobuf/ \
&& ./autogen.sh \
&& ./configure \
&& sudo make \
&& sudo make install \
&& cd /home/grpc/third_party/protobuf/python \
&& python setup.py build \
&& python setup.py install
# Install mosquitto
RUN cd /home \
&& sudo apt-get install -y pkg-config cmake openssl libc-ares-dev libssl-dev python-mosquitto \
&& wget http://mosquitto.org/files/source/mosquitto-1.3.5.tar.gz \
&& tar xzf mosquitto-1.3.5.tar.gz \
&& cd mosquitto-1.3.5 \
&& cmake . \
&& sudo make install \
&& apt-get install -y python-pip \
&& pip install paho-mqtt \
&& useradd mosquitto
# Install jsoncpp
RUN cd /home \
&& git clone https://github.com/open-source-parsers/jsoncpp.git \
&& cd jsoncpp \
&& mkdir -p build/debug \
&& cd build/debug \
&& cmake -DCMAKE_BUILD_TYPE=debug -DJSONCPP_LIB_BUILD_STATIC=ON-DJSONCPP_LIB_BUILD_SHARED=OFF -G "Unix Makefiles" ../.. \
&& make \
&& make install
# Install and setup ssh service
RUN apt-get -y install ssh \
&& mkdir /var/run/sshd \
&& echo 'root:grpc' | chpasswd \
&& sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
&& sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
ENV ROOTPATH=/home/jvsim
ENV LD_LIBRARY_PATH=/usr/local/lib
RUN mkdir /home/jvsim
COPY bin /home/jvsim/bin
COPY config /home/jvsim/config
RUN mkdir /home/jvsim/logs
COPY occam /home/jvsim/occam
COPY protos /home/jvsim/protos
COPY src /home/jvsim/src
COPY Makefile /home/jvsim/Makefile
WORKDIR /home/jvsim
RUN sudo ldconfig \
&& export LD_LIBRARY_PATH=/usr/local/lib \
&& export ROOTPATH=/home/jvsim \
&& make all
# Expose the default telemetry GRPC agent server.
# Change to desired value if needed.
EXPOSE 50051
EXPOSE 22
CMD service ssh restart && bash