forked from istio/proxy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
32 lines (24 loc) · 871 Bytes
/
build.sh
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
#!/bin/bash
# Build waypoint image in the x86 env:
# ARCH=x86 bash build.sh
#
# Build waypoint image in the arm env:
# ARCH=arm bash build.sh
REPO=${1:-"kmesh-net"}
# Build Envoy
BUILD_WITH_CONTAINER=1 make build_envoy
docker create --name temp -v cache:/home/.cache busybox
if [ "$ARCH" = "arm" ]; then
docker cp temp:/home/.cache/bazel/_bazel_root/1e0bb3bee2d09d2e4ad3523530d3b40c/execroot/io_istio_proxy/bazel-out/aarch64-opt/bin/envoy .
else
docker cp temp:/home/.cache/bazel/_bazel_root/1e0bb3bee2d09d2e4ad3523530d3b40c/execroot/io_istio_proxy/bazel-out/k8-opt/bin/envoy .
fi
docker rm temp
if [ "$ARCH" = "arm" ]; then
docker build . --no-cache -t ghcr.io/$REPO/waypoint-arm:latest
elif [ "$ARCH" = "x86" ]; then
docker build . --no-cache -t ghcr.io/$REPO/waypoint-x86:latest
else
docker build . --no-cache -t ghcr.io/$REPO/waypoint:latest
fi
rm envoy