-
Notifications
You must be signed in to change notification settings - Fork 82
/
Dockerfile
60 lines (42 loc) · 1.26 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
53
54
55
56
57
58
59
60
ARG VPP_VERSION=v24.06
ARG UBUNTU_VERSION=22.04
FROM ubuntu:${UBUNTU_VERSION} as vppbuild
RUN set -eux;\
apt-get update && env DEBIAN_FRONTEND=noninteractive TZ=US/Central apt-get install -y \
asciidoc \
ca-certificates \
git \
iproute2 \
iputils-ping \
make \
python3 \
sudo \
tcpdump \
rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/FDio/vpp.git
WORKDIR /vpp
ARG VPP_VERSION
RUN git checkout ${VPP_VERSION}
RUN set -eux; \
env DEBIAN_FRONTEND=noninteractive TZ=US/Central UNATTENDED=y make install-dep
RUN set -eux; \
make pkg-deb \
./src/scripts/version > /vpp/VPP_VERSION
FROM vppbuild as vppinstall
RUN set -eux; \
env VPP_INSTALL_SKIP_SYSCTL=false apt install -f -y --no-install-recommends /vpp/build-root/*.deb ; \
rm -rf /var/lib/apt/lists/*; \
rm -rf /pkg
FROM golang:1.22-alpine3.19 as binapi-generator
ENV GO111MODULE=on
ENV CGO_ENABLED=0
ENV GOBIN=/bin
ARG GOVPP_VERSION
COPY . /govpp
WORKDIR /govpp
RUN go build -o /bin/binapi-generator ./cmd/binapi-generator
FROM binapi-generator as gen
COPY --from=vppinstall /usr/share/vpp/api/ /usr/share/vpp/api/
COPY --from=vppinstall /vpp/VPP_VERSION /VPP_VERSION
WORKDIR /gen/binapi
CMD VPP_VERSION=$(cat /VPP_VERSION) go generate .