-
Notifications
You must be signed in to change notification settings - Fork 461
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (40 loc) · 1.38 KB
/
Dockerfile
File metadata and controls
55 lines (40 loc) · 1.38 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
50
51
52
53
54
55
# 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-main ./
# docker run -p 179:1790 --mount type=bind,source=`pwd`/etc/exabgp,target=/etc/exabgp exabgp-main version
# docker run -it exabgp-main version
# docker run -it exabgp-main etc/exabgp/exabgp.conf
# debug the build
# docker build --progress=plain --no-cache -t exabgp ./
FROM python:3.13-bookworm AS builder
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
WORKDIR /build
COPY . /build/
# Build application wheel
RUN uv build --wheel
# Install the application into /app
RUN pip install --target /opt/exabgp dist/*.whl
FROM python:3.13-slim-bookworm
COPY --from=builder /opt/exabgp /opt/exabgp
ENV PYTHONPATH=/opt/exabgp
ENV PATH=/opt/exabgp/bin:$PATH
# install deps
RUN apt-get update \
&& apt-get install -y iproute2 dumb-init \
&& apt-get clean
# Add 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 \
&& echo "user = 'exa'" >> /opt/exabgp/etc/exabgp/exabgp.env
ENTRYPOINT [ \
"/usr/bin/dumb-init", "--", \
"exabgp" \
]