-
Notifications
You must be signed in to change notification settings - Fork 46
/
rebuild.sh
executable file
·32 lines (22 loc) · 839 Bytes
/
rebuild.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
DOCKER="docker"
set -eu -o pipefail
${DOCKER} build --platform linux/amd64 -t libbpf-sys-builder - <<'EOF'
FROM ubuntu:jammy AS libbpf-sys-builder
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8
VOLUME /usr/local/src/libbpf-sys
WORKDIR /usr/local/src/libbpf-sys
SHELL ["/bin/bash", "-eu", "-o", "pipefail", "-c"]
RUN \
export DEBIAN_FRONTEND=noninteractive; \
apt-get -q update; \
apt-get -q install -y curl build-essential zlib1g-dev libelf-dev libclang-dev llvm clang pkg-config; \
apt-get -q clean autoclean;
RUN \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable;
ENTRYPOINT \
source $HOME/.cargo/env; \
cargo build --features bindgen-source --release --verbose;
EOF
${DOCKER} run --platform linux/amd64 --rm -v "$(pwd):/usr/local/src/libbpf-sys" libbpf-sys-builder