-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
53 lines (39 loc) · 1.49 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
42
43
44
45
46
47
48
49
50
51
52
FROM golang:1-buster as grpc_interface_builder
ARG DEBIAN_FRONTEND=noninteractive
ENV GOPATH=/root/go
RUN apt-get update -y \
&& apt-get install -y python3 python3-pip python3-setuptools
RUN pip3 install --upgrade grpcio-tools
COPY . /pilot
WORKDIR /pilot
RUN mkdir -p "$GOPATH" \
&& ./scripts/build_grpc.sh
FROM debian:buster-slim as gobgp_builder
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y \
&& apt-get install -y wget tar
WORKDIR /root
ARG GOBGP_DOWNLOAD_URL=https://github.com/osrg/gobgp/releases/download/v2.15.0/gobgp_2.15.0_linux_amd64.tar.gz
RUN wget ${GOBGP_DOWNLOAD_URL} -O gobgp.tar.gz \
&& tar -xvf gobgp.tar.gz
FROM python:3-buster
LABEL maintainer="[email protected]"
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends supervisor curl \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
COPY --from=gobgp_builder /root/gobgp /root/gobgpd /usr/local/bin/
RUN setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/gobgpd
COPY . /tmp/pilot
COPY --from=grpc_interface_builder /pilot/pilot/gobgp_interface /tmp/pilot/pilot/gobgp_interface
RUN cd /tmp/pilot \
&& python3 setup.py install \
&& rm -rf /tmp/pilot \
&& setcap CAP_NET_BIND_SERVICE=+eip $(realpath $(which python))
COPY supervisor /etc/supervisor/
COPY config /etc/pilot/
ENV GOBGP_API_LISTEN="127.0.0.1:50051"
EXPOSE 80/tcp
CMD [ "supervisord", "-c", "/etc/supervisor/supervisor.conf", "-n" ]