Skip to content

Commit 141cb4e

Browse files
authored
Merge pull request #1431 from stanislav-chlebec/master
WIP: fix arm64 docker image building
2 parents f78ee48 + 8761a5c commit 141cb4e

File tree

3 files changed

+27
-26
lines changed

3 files changed

+27
-26
lines changed

docker/vpp-cni/Dockerfile.arm64

+23-24
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,45 @@
11
FROM arm64v8/golang:1.10.7-alpine3.8 as builder
22

3+
# we want a static binary
4+
ENV CGO_ENABLED=0
5+
6+
RUN apk add --update wget git make gcc linux-headers libc-dev
7+
8+
COPY . /go/src/github.com/contiv/vpp
9+
310
# we need the loopback binary from CNI
411
# this binary can be obtained from the cni tarball
5-
RUN apk add --update wget \
6-
&& export CNI_VERSION=0.5.1 \
7-
&& wget https://github.com/containernetworking/cni/releases/download/v$CNI_VERSION/cni-arm64-v$CNI_VERSION.tgz \
8-
-O /cni.tgz \
12+
RUN export CNI_VERSION=0.5.1 \
13+
&& wget https://github.com/containernetworking/cni/releases/download/v$CNI_VERSION/cni-arm64-v$CNI_VERSION.tgz -O /cni.tgz \
914
&& mkdir /cni \
10-
&& tar -xvf /cni.tgz -C /cni \
11-
&& rm /cni.tgz
12-
COPY . /go/src/github.com/contiv/vpp
15+
&& tar -xvf /cni.tgz -C /cni
1316

1417
# Build a custom version of the portmap plugin, modified for VPP-based networking.
15-
RUN apk add --update git gcc linux-headers libc-dev \
16-
&& export CGO_ENABLED=0 \
17-
&& export CNI_PLUGIN_VERSION=0.7 \
18+
RUN export CNI_PLUGIN_VERSION=0.7 \
1819
&& mkdir -p /go/src/github.com/containernetworking \
1920
&& cd /go/src/github.com/containernetworking \
2021
&& git clone https://github.com/containernetworking/plugins.git -b v$CNI_PLUGIN_VERSION \
2122
&& cd plugins/plugins/meta/portmap/ \
2223
&& git apply /go/src/github.com/contiv/vpp/docker/vpp-cni/portmap.diff \
2324
&& go build -ldflags '-s -w' -o /portmap
2425

25-
WORKDIR /go/src/github.com/contiv/vpp/cmd/contiv-cni
26+
WORKDIR /go/src/github.com/contiv/vpp
27+
28+
# build contiv-cni
29+
RUN make contiv-cni
2630

2731
# we collect & store all files in one folder to make the resulting
2832
# image smaller when we copy them all in one single operation
29-
RUN export CGO_ENABLED=0 \
30-
&& mkdir /output/ \
31-
&& cp /cni/loopback /output/ \
32-
&& cp /go/src/github.com/contiv/vpp/docker/vpp-cni/10-contiv-vpp.conflist /output/ \
33-
&& cp /go/src/github.com/contiv/vpp/docker/vpp-cni/install.sh /output/ \
34-
&& cp /portmap /output/ \
35-
&& go build -ldflags '-s -w' -o /output/contiv-cni contiv_cni.go
36-
33+
RUN mkdir -p /output/cni/bin && mkdir -p /output/cni/cfg \
34+
&& cp cmd/contiv-cni/contiv-cni /output/cni/bin/ \
35+
&& cp /cni/loopback /output/cni/bin/ \
36+
&& cp /portmap /output/cni/bin/ \
37+
&& cp /go/src/github.com/contiv/vpp/docker/vpp-cni/install.sh /output/cni/ \
38+
&& cp /go/src/github.com/contiv/vpp/docker/vpp-cni/10-contiv-vpp.conflist /output/cni/cfg/
3739

3840
FROM arm64v8/alpine:3.8
3941

40-
# set work directory
41-
WORKDIR /root/
42-
43-
COPY --from=builder /output/* /root/
42+
COPY --from=builder /output/cni /cni
4443

4544
# run install script by default
46-
CMD ["/root/install.sh"]
45+
CMD ["/cni/install.sh"]

docker/vpp-ksr/Dockerfile.arm64

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ FROM scratch
1515

1616
COPY --from=builder /go/src/github.com/contiv/vpp/cmd/contiv-ksr/contiv-ksr /contiv-ksr
1717

18-
ENTRYPOINT ["/contiv-ksr"]
18+
ENTRYPOINT ["/contiv-ksr"]

docker/vpp-vswitch/prod/vswitch/Dockerfile.arm64

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM arm64v8/ubuntu:18.04
22

33
RUN apt-get update \
44
&& apt-get install -y \
5-
# vpp-agent & vpp process manger
5+
# vpp-agent & vpp process manager
66
python supervisor \
77
# vpp requirements
88
openssl libapr1 libnuma1 libmbedcrypto1 libmbedtls10 libmbedx509-0 \
@@ -12,6 +12,8 @@ RUN apt-get update \
1212
iproute2 iputils-ping inetutils-traceroute \
1313
# ability to run vpptrace.sh
1414
netcat-openbsd \
15+
# ability to visualize graph of configured objects
16+
graphviz \
1517
&& rm -rf /var/lib/apt/lists/*
1618

1719
# use /opt/vpp-agent/dev as the working directory

0 commit comments

Comments
 (0)