@@ -12,7 +12,6 @@ ARG RUSTC_VERSION=1.84.0
12
12
ARG NODEJS_VERSION=20.15.0
13
13
ARG OPA_VERSION=0.64.1
14
14
ARG CARGO_AUDITABLE_VERSION=0.6.6
15
- ARG CARGO_CHEF_VERSION=0.1.68
16
15
17
16
# #########################################
18
17
# # Build stage that builds the frontend ##
@@ -56,23 +55,18 @@ RUN --network=none \
56
55
make -B && \
57
56
chmod a+r ./policy.wasm
58
57
59
- # #########################################################################
60
- # # Base image with cargo-chef and the right cross-compilation toolchain ##
61
- # #########################################################################
62
- FROM --platform=${BUILDPLATFORM} docker.io/library/rust:${RUSTC_VERSION}-${DEBIAN_VERSION_NAME} AS toolchain
58
+ # #######################################
59
+ # # Build stage that builds the binary ##
60
+ # #######################################
61
+ FROM --platform=${BUILDPLATFORM} docker.io/library/rust:${RUSTC_VERSION}-${DEBIAN_VERSION_NAME} AS builder
63
62
64
63
ARG CARGO_AUDITABLE_VERSION
65
- ARG CARGO_CHEF_VERSION
66
64
ARG RUSTC_VERSION
67
65
68
- # Make cargo use the git cli for fetching dependencies
69
- ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
70
-
71
- # Install pinned versions of cargo-chef and cargo-auditable
66
+ # Install pinned versions of cargo-auditable
72
67
# Network access: to fetch dependencies
73
68
RUN --network=default \
74
69
cargo install --locked \
75
- cargo-chef@=${CARGO_CHEF_VERSION} \
76
70
cargo-auditable@=${CARGO_AUDITABLE_VERSION}
77
71
78
72
# Install all cross-compilation targets
@@ -111,35 +105,7 @@ ENV \
111
105
# Set the working directory
112
106
WORKDIR /app
113
107
114
- # ####################################
115
- # # Run the planner from cargo-chef ##
116
- # ####################################
117
- FROM --platform=${BUILDPLATFORM} toolchain AS planner
118
- COPY ./Cargo.toml ./Cargo.lock /app/
119
- COPY ./crates /app/crates
120
- RUN --network=none \
121
- cargo chef prepare --recipe-path recipe.json --bin crates/cli
122
-
123
- # #######################
124
- # # Actual build stage ##
125
- # #######################
126
- FROM --platform=${BUILDPLATFORM} toolchain AS builder
127
-
128
- # Build dependencies
129
- COPY --from=planner /app/recipe.json recipe.json
130
- # Network access: cargo-chef cook fetches the dependencies
131
- RUN --network=default \
132
- cargo chef cook \
133
- --bin mas-cli \
134
- --release \
135
- --recipe-path recipe.json \
136
- --no-default-features \
137
- --features docker \
138
- --target x86_64-unknown-linux-gnu \
139
- --target aarch64-unknown-linux-gnu \
140
- --package mas-cli
141
-
142
- # Build the rest
108
+ # Copy the code
143
109
COPY ./ /app
144
110
ENV SQLX_OFFLINE=true
145
111
0 commit comments