forked from Exa-Networks/exabgp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.remote
50 lines (37 loc) · 1.53 KB
/
Dockerfile.remote
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
# syntax=docker/dockerfile:1.4
# how to build and run exabgp using docker (from github with pip)
# this Dockerfile does not require a local installation but the container is bigger
# docker build . --build-arg version=main -f Dockerfile.remote -t exabgp.remote
# docker run -p 179:1790 --mount type=bind,source=`pwd`/etc/exabgp,target=/etc/exabgp exabgp.remote version
# docker run -it exabgp.remote version
# docker run -it exabgp-main etc/exabgp/exabgp.conf
# debug the build
# docker build --progress=plain --no-cache --build-arg version=main -f Dockerfile.remote -t exabgp ./
FROM python:3-slim
ARG version="main"
RUN apt-get update \
&& apt-get install -y iproute2 git dumb-init \
&& apt-get clean
RUN pip install --upgrade pip
ADD . /opt/exabgp
RUN useradd -r exa \
&& mkdir /etc/exabgp \
&& mkfifo /run/exabgp.in \
&& mkfifo /run/exabgp.out \
&& chown exa /run/exabgp.in \
&& chown exa /run/exabgp.out \
&& chmod 600 /run/exabgp.in \
&& 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
# set the version to the date to pass setuptool PEP 440 check
# it will not change the version when the program is running
RUN cd /tmp \
&& echo Building ${version} \
&& pip install -U setuptools \
&& env EXABGP_VERSION=`date +%Y.%m.%d` pip install git+https://github.com/Exa-Networks/exabgp.git@${version}
WORKDIR /etc/exabgp
ENTRYPOINT [ \
"/usr/bin/dumb-init", "--", \
"/usr/local/bin/exabgp" \
]