forked from Exa-Networks/exabgp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (32 loc) · 1.02 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
# syntax=docker/dockerfile:1.4
# how to build and run exabgp using docker (using the local copy)
# this dockerfile install exabgp in the container /opt
# docker build -t exabgp ./
# docker run -p 179:1790 --mount type=bind,source=`pwd`/etc/exabgp,target=/etc/
# debug the build
# docker build --progress=plain --no-cache -t exabgp ./
FROM python:3-slim-buster
# update packages
RUN apt update
RUN apt -y dist-upgrade
RUN apt install -y dumb-init
RUN rm -rf /var/lib/apt/lists/* /var/cache/apt/*
# Add ExaBGP
ADD . /opt/exabgp
RUN useradd -r exa
RUN mkdir /etc/exabgp
RUN mkfifo /run/exabgp.in
RUN mkfifo /run/exabgp.out
RUN chown exa /run/exabgp.in
RUN chown exa /run/exabgp.out
RUN chmod 600 /run/exabgp.in
RUN chmod 600 /run/exabgp.out
RUN echo "[exabgp.daemon]" > /opt/exabgp/etc/exabgp/exabgp.env
RUN echo "user = 'exa'" >> /opt/exabgp/etc/exabgp/exabgp.env
ENV PYTHONPATH=/opt/exabgp/src
ENV PATH=$PATH:/opt/exabgp/sbin/
# ENTRYPOINT [ "/bin/bash"]
ENTRYPOINT [ \
"/usr/bin/dumb-init", "--", \
"/opt/exabgp/sbin/exabgp" \
]