-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (36 loc) · 1.28 KB
/
Dockerfile
File metadata and controls
47 lines (36 loc) · 1.28 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
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://src.libcode.org/pkun/faux.git && \
cd faux && \
./autogen.sh && \
./configure --prefix=/usr && \
make -j"$(nproc)" && \
make install
# Build and install klish
RUN git clone --branch 3.2.0 https://src.libcode.org/pkun/klish.git && \
cd klish && \
./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"]