Skip to content

Commit c24c3ee

Browse files
authored
Speed up local docker rebuilds & CI cache exports (#4289)
2 parents 771a970 + 6903c3d commit c24c3ee

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

Dockerfile

+11-13
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,18 @@ ENV VERGEN_GIT_DESCRIBE=${VERGEN_GIT_DESCRIBE}
114114

115115
# Network access: cargo auditable needs it
116116
RUN --network=default \
117+
--mount=type=cache,target=/root/.cargo/registry \
118+
--mount=type=cache,target=/app/target \
117119
cargo auditable build \
118-
--locked \
119-
--release \
120-
--bin mas-cli \
121-
--no-default-features \
122-
--features docker \
123-
--target x86_64-unknown-linux-gnu \
124-
--target aarch64-unknown-linux-gnu
125-
126-
# Move the binary to avoid having to guess its name in the next stage
127-
RUN --network=none \
128-
mv "target/x86_64-unknown-linux-gnu/release/mas-cli" /usr/local/bin/mas-cli-amd64
129-
RUN --network=none \
130-
mv "target/aarch64-unknown-linux-gnu/release/mas-cli" /usr/local/bin/mas-cli-arm64
120+
--locked \
121+
--release \
122+
--bin mas-cli \
123+
--no-default-features \
124+
--features docker \
125+
--target x86_64-unknown-linux-gnu \
126+
--target aarch64-unknown-linux-gnu \
127+
&& mv "target/x86_64-unknown-linux-gnu/release/mas-cli" /usr/local/bin/mas-cli-amd64 \
128+
&& mv "target/aarch64-unknown-linux-gnu/release/mas-cli" /usr/local/bin/mas-cli-arm64
131129

132130
#######################################
133131
## Prepare /usr/local/share/mas-cli/ ##

0 commit comments

Comments
 (0)