-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
126 lines (110 loc) · 3.32 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
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
FROM debian:stable
ENV HOME=/root
ENV TZ=Europe/Prague
ENV LC_ALL=en_US.utf8
ENV DEBIAN_FRONTEND=noninteractive
# Install base packages
RUN \
sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
sed -i 's#debian-security stable/updates#debian-security stable-security/updates#g' /etc/apt/sources.list && \
echo "# Installing base packages" && \
apt-get update && \
apt-get -y upgrade && \
apt-get -y install --no-install-recommends \
lua5.1 liblua5.1-0-dev libjson-c-dev ca-certificates \
git cmake make pkg-config gcc g++ openssh-client bzip2 \
python3-prctl python3-dev python3-setuptools python3-jsonschema \
python3-pip python3-pbkdf2 locales gpg gpg-agent libcap-dev \
mosquitto wireguard-tools \
curl wget build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev \
libsqlite3-dev llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev \
&& \
apt-get clean
# Set Timezone
RUN \
rm -f /etc/localtime && \
echo "$TZ" > /etc/timezone && \
dpkg-reconfigure -f noninteractive tzdata
# Update python paths
RUN \
update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
# Generate locales
RUN \
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen
# Compile libubox
RUN \
mkdir -p ~/build && \
cd ~/build && \
rm -rf libubox && \
git clone git://git.openwrt.org/project/libubox.git && \
cd ~/build/libubox && \
git checkout master && \
cmake CMakeLists.txt -DCMAKE_INSTALL_PREFIX:PATH=/usr && \
make install
# Compile uci
RUN \
mkdir -p ~/build && \
cd ~/build && \
rm -rf uci && \
git clone git://git.openwrt.org/project/uci.git && \
cd ~/build/uci && \
git checkout master && \
cmake CMakeLists.txt -DCMAKE_INSTALL_PREFIX:PATH=/usr && \
make install
# Compile ubus
RUN \
mkdir -p ~/build && \
cd ~/build && \
rm -rf ubus && \
git clone https://gitlab.nic.cz/turris/ubus.git && \
cd ~/build/ubus && \
git checkout master && \
cmake CMakeLists.txt -DCMAKE_INSTALL_PREFIX:PATH=/usr && \
make install
# Install ubus python bindings
RUN \
mkdir -p ~/build && \
cd ~/build && \
rm -rf python-ubus && \
git clone https://gitlab.nic.cz/turris/python-ubus.git && \
cd ~/build/python-ubus && \
pip install --break-system-packages .
# Compile iwinfo
RUN \
mkdir -p ~/build && \
cd ~/build && \
rm -rf iwinfo && \
git clone git://git.openwrt.org/project/iwinfo.git && \
cd iwinfo && \
ln -s /usr/lib/x86_64-linux-gnu/liblua5.1.so liblua.so && \
CFLAGS="-I/usr/include/lua5.1/" LD=ld FPIC="-fPIC" LDFLAGS="-lc -shared" make && \
cp -r include/* /usr/local/include/ && \
cp libiwinfo.so /usr/local/lib/
# Compile rpcd
RUN \
mkdir -p ~/build && \
cd ~/build && \
rm -rf rpcd && \
git clone git://git.openwrt.org/project/rpcd.git && \
cd rpcd && \
cmake CMakeLists.txt && \
make install
# Add Gitlab's SSH key
RUN \
mkdir /root/.ssh && \
ssh-keyscan gitlab.nic.cz > /root/.ssh/known_hosts
# Install pyenv
ENV PYENV_ROOT="/root/.pyenv"
ENV PATH "$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH"
RUN \
curl https://pyenv.run | bash
# Install pythons
RUN pyenv install 3.6.14
RUN pyenv install 3.7.11
RUN pyenv install 3.8.11
RUN pyenv install 3.9.6
RUN pyenv local system 3.6.14 3.7.11 3.8.11 3.9.6
CMD [ "bash" ]