forked from sysrepo/sysrepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.gentoo
155 lines (135 loc) · 3.93 KB
/
Dockerfile.gentoo
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
FROM gentoo/stage3-amd64
MAINTAINER [email protected]
# update system
RUN \
emerge --sync
# install basic dependencies
RUN \
emerge -q \
automake \
bison \
flex \
dev-vcs/git \
cmake \
vim \
supervisor \
# libyang
pkg-config \
# sysrepo
libev \
protobuf-c \
# netopeer2 \
# libssh
# bindings
swig
# Netopeer2 requires ssh server
RUN USE=server emerge -q libssh
# add password to root
RUN \
echo "root:root" | chpasswd
# add netconf user
RUN \
useradd --system netconf && \
echo "netconf:netconf" | chpasswd
# use /opt/dev as working directory
RUN mkdir /opt/dev
WORKDIR /opt/dev
# generate default ssh key
RUN \
ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key
# libredblack
RUN \
git clone https://github.com/sysrepo/libredblack.git && \
cd libredblack && \
sed -i '1s/^/#!\/usr\/bin\/env python2\n/' rbgen.in && \
./configure --prefix=/usr && \
make && \
make install && \
ldconfig
# libyang
RUN \
git clone https://github.com/CESNET/libyang.git && \
cd libyang && mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE:String="Release" .. && \
make -j2 && \
make install && \
ldconfig
# sysrepo
RUN \
git clone https://github.com/sysrepo/sysrepo.git && \
cd sysrepo && mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE:String="Release" -DREPOSITORY_LOC:PATH=/etc/sysrepo .. && \
make -j2 && \
make install && \
ldconfig
# libnetconf2
RUN \
git clone https://github.com/CESNET/libnetconf2.git && \
cd libnetconf2 && mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE:String="Release" .. && \
make -j2 && \
make install && \
ldconfig
# keystore
RUN \
cd /opt/dev && \
git clone https://github.com/CESNET/Netopeer2.git && \
cd Netopeer2 && \
cd keystored && mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE:String="Release" .. && \
make -j2 && \
make install && \
ldconfig
# netopeer2
RUN \
cd /opt/dev && \
cd Netopeer2/server && \
mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE:String="Release" .. && \
make -j2 && \
make install && \
cd ../../cli && mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE:String="Release" .. && \
make -j2 && \
make install
# install python2 sysrepo language bindings
RUN emerge -q python:2.7
RUN \
cd /opt/dev/sysrepo/build && \
make clean && \
cmake -DGEN_PYTHON_VERSION=2 .. && \
make -j2 && \
make install
# install lua5.1 sysrepo language bindings
RUN \
echo "=app-eselect/eselect-lua-1 ~amd64" >> /etc/portage/package.accept_keywords && \
echo "=dev-lang/lua-5.1.5-r100 ~amd64" >> /etc/portage/package.accept_keywords && \
echo "=dev-lang/lua-5.1.5-r100" >> /etc/portage/package.unmask && \
echo "=app-eselect/eselect-lua-1" >> /etc/portage/package.unmask && \
emerge -q lua:5.1
RUN \
cd /opt/dev/sysrepo/build && \
make clean && \
cmake -DGEN_LUA_VERSION=5.1 .. && \
make -j2 && \
make install
# install python3 sysrepo language bindings
RUN emerge -q python:3.4
RUN \
cd /opt/dev/sysrepo && \
# cmake requires new directory for switching python version \
mkdir build_python3 && cd build_python3 && \
cmake -DGEN_PYTHON_VERSION=3 .. && \
make -j2 && \
make install
RUN \
cd /opt/dev/sysrepo && \
# cmake requires new directory for switching lua version \
mkdir build_lua52 && cd build_lua52 && \
cmake -DGEN_LUA_VERSION=5.2 .. && \
make -j2 && \
make install
ENV EDITOR vim
EXPOSE 830
COPY supervisord.conf /etc/supervisord.conf
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]