-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile-prod
70 lines (58 loc) · 3.29 KB
/
Dockerfile-prod
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
FROM debian:bookworm-slim
MAINTAINER Italo Valcy <[email protected]>
ARG branch_python_openflow=master
ARG branch_kytos_utils=master
ARG branch_kytos=master
ARG branch_of_core=master
ARG branch_flow_manager=master
ARG branch_topology=master
ARG branch_of_lldp=master
ARG branch_pathfinder=master
ARG branch_mef_eline=master
ARG branch_maintenance=master
ARG branch_coloring=master
ARG branch_sdntrace=master
ARG branch_kytos_stats=master
ARG branch_sdntrace_cp=master
# USAGE: ... --build-arg release_ui=download/2022.2.0 ...
ARG release_ui=latest/download
RUN apt-get update && apt-get install -y --no-install-recommends \
python3-setuptools patch python3-pip orphan-sysvinit-scripts iproute2 procps curl git-core \
vim jq less tmux nginx \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN rm /usr/lib/python3.11/EXTERNALLY-MANAGED
RUN python3 -m pip install setuptools==69.1.1
RUN python3 -m pip install pip==24.0
RUN python3 -m pip install wheel==0.42.0
RUN python3 -m pip install https://github.com/kytos-ng/python-openflow/archive/${branch_python_openflow}.zip \
&& python3 -m pip install https://github.com/kytos-ng/kytos-utils/archive/${branch_kytos_utils}.zip \
&& python3 -m pip install https://github.com/kytos-ng/kytos/archive/${branch_kytos}.zip
COPY kytos.conf /etc/kytos/
COPY logging.ini /etc/kytos/
RUN sed -i "s/XXXJWTSECRETXXX/$(python3 -c 'import secrets; print(secrets.token_hex(16))')/g" /etc/kytos/kytos.conf
RUN mkdir /var/log/kytos && touch /var/log/kytos/kytos-error.log /var/log/kytos/kytos.log
RUN python3 -m pip install -e git+https://github.com/kytos-ng/of_core@${branch_of_core}#egg=kytos-of_core \
&& python3 -m pip install -e git+https://github.com/kytos-ng/flow_manager@${branch_flow_manager}#egg=kytos-flow_manager \
&& python3 -m pip install -e git+https://github.com/kytos-ng/topology@${branch_topology}#egg=kytos-topology \
&& python3 -m pip install -e git+https://github.com/kytos-ng/of_lldp@${branch_of_lldp}#egg=kytos-of_lldp \
&& python3 -m pip install -e git+https://github.com/kytos-ng/pathfinder@${branch_pathfinder}#egg=kytos-pathfinder \
&& python3 -m pip install -e git+https://github.com/kytos-ng/maintenance@${branch_maintenance}#egg=kytos-maintenance \
&& python3 -m pip install -e git+https://github.com/kytos-ng/coloring@${branch_coloring}#egg=amlight-coloring \
&& python3 -m pip install -e git+https://github.com/kytos-ng/sdntrace@${branch_sdntrace}#egg=amlight-sdntrace \
&& python3 -m pip install -e git+https://github.com/kytos-ng/kytos_stats@${branch_kytos_stats}#egg=amlight-kytos_stats \
&& python3 -m pip install -e git+https://github.com/kytos-ng/sdntrace_cp@${branch_sdntrace_cp}#egg=amlight-sdntrace_cp \
&& python3 -m pip install -e git+https://github.com/kytos-ng/mef_eline@${branch_mef_eline}#egg=kytos-mef_eline \
&& curl -L -o /tmp/latest.zip https://github.com/kytos-ng/ui/releases/${release_ui}/latest.zip \
&& python3 -m zipfile -e /tmp/latest.zip /usr/local/lib/python3.11/dist-packages/kytos/web-ui \
&& rm -f /tmp/latest.zip
COPY ./apply-patches.sh /tmp/
COPY ./patches /tmp/patches
RUN cd /tmp && ./apply-patches.sh && rm -rf /tmp/*
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
COPY ./nginx.htpasswd /etc/nginx/nginx.htpasswd
WORKDIR /
COPY docker-entrypoint.sh /docker-entrypoint.sh
EXPOSE 6653
EXPOSE 8080
ENTRYPOINT ["/docker-entrypoint.sh"]