Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (38 loc) · 1.42 KB
/
Copy pathDockerfile
File metadata and controls
49 lines (38 loc) · 1.42 KB
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
FROM ubuntu:24.04
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
git build-essential autoconf automake libtool \
pkg-config libxml2-dev libxslt1-dev ca-certificates \
less iputils-ping iproute2 net-tools jq jc \
lua5.3 liblua5.3-dev
WORKDIR /opt
# Build and install libfaux (required by klish v3)
RUN git clone --branch 2.2.1 https://github.com/pkun/faux.git && \
cd faux && \
./autogen.sh && \
./configure --prefix=/usr && \
make -j"$(nproc)" && \
make install
# Build and install klish (with smart command suggestion patch)
COPY klish/patches/klish-suggest.patch /tmp/klish-suggest.patch
RUN git clone --branch 3.2.0 https://github.com/pkun/klish.git && \
cd klish && \
git apply /tmp/klish-suggest.patch && \
./autogen.sh && \
./configure --prefix=/usr --with-libxml2=/usr --with-lua && \
make -j"$(nproc)" && \
make install
WORKDIR /opt/netlab-cli
COPY klish/xml ./xml
COPY klish/scripts ./scripts
RUN mkdir -p /opt/netlab-cli/data && \
chmod +x ./scripts/*.sh
# Put XML where klishd (libxml2 DB) expects it for root: ~/.klish/*.xml
RUN mkdir -p /root/.klish && \
cp ./xml/*.xml /root/.klish/
# Klish daemon/client configs
COPY klish/config/klishd.conf /etc/klish/klishd.conf
COPY klish/config/klish.conf /etc/klish/klish.conf
COPY klish/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]