File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -112,9 +112,8 @@ jobs:
112
112
platform :
113
113
- os : ubuntu-22.04
114
114
arch : amd64
115
- # TODO: fix
116
- # - os: ubuntu-22.04-arm
117
- # arch: arm64
115
+ - os : ubuntu-22.04-arm
116
+ arch : arm64
118
117
119
118
steps :
120
119
- name : Checkout
Original file line number Diff line number Diff line change 1
- FROM --platform=$BUILDPLATFORM rust:1.84 AS rust_builder
2
-
3
- # We need libclang to do the bindgen.
4
- RUN apt update && apt install -y clang
1
+ FROM --platform=$BUILDPLATFORM rust:1.84 AS rust_fetcher
5
2
6
3
WORKDIR /app
7
4
8
- # Cache dependencies by copying only the Cargo files and fetching them.
5
+ # Cache dependencies by copying only the Cargo files and fetching them on the build platform .
9
6
COPY ./rust/Cargo.toml ./rust/Cargo.lock ./
10
7
RUN mkdir src && echo "" > src/lib.rs
11
8
RUN cargo fetch
12
9
RUN rm -rf src
13
10
11
+ FROM rust:1.84 AS rust_builder
12
+
13
+ # We need libclang to do the bindgen.
14
+ RUN apt update && apt install -y clang
15
+
16
+ # Copy the dependencies from the previous stage.
17
+ WORKDIR /app
18
+ COPY --from=rust_fetcher /usr/local/cargo/git /usr/local/cargo/git
19
+ COPY --from=rust_fetcher /usr/local/cargo/registry /usr/local/cargo/registry
20
+
14
21
# Then, copy the entire source code and build.
15
22
COPY ./rust .
16
23
RUN cargo build
17
24
18
25
# Finally, copy the built library to the final image.
19
- FROM --platform=$BUILDPLATFORM envoyproxy/envoy-dev:80c1ac2143a7a73932c9dff814d38fd6867fe691 AS envoy
26
+ FROM envoyproxy/envoy-dev:80c1ac2143a7a73932c9dff814d38fd6867fe691 AS envoy
20
27
ENV ENVOY_DYNAMIC_MODULES_SEARCH_PATH=/usr/local/lib
21
28
COPY --from=rust_builder /app/target/debug/librust_module.so /usr/local/lib/librust_module.so
You can’t perform that action at this time.
0 commit comments