-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: reduce size of Rust interop-test image
This is an automatic backport of pull request #3926 done by [Mergify](https://mergify.com). Pull-Request: #3945.
- Loading branch information
1 parent
2d9ae38
commit 8c26c61
Showing
1 changed file
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
# syntax=docker/dockerfile:1.5-labs | ||
FROM rust:1.67.0 | ||
FROM rust:1.67.0 as builder | ||
|
||
# Install zlib as long as libp2p-websocket requires it: https://github.com/paritytech/soketto/issues/72 | ||
RUN apt-get update && \ | ||
apt-get download zlib1g && \ | ||
mkdir /dpkg && \ | ||
for deb in *.deb; do dpkg --extract $deb /dpkg || exit 10; done | ||
|
||
# Run with access to the target cache to speed up builds | ||
WORKDIR /workspace | ||
ADD . . | ||
RUN --mount=type=cache,target=./target \ | ||
--mount=type=cache,target=/usr/local/cargo/registry \ | ||
cargo build --package interop-tests | ||
cargo build --release --package interop-tests | ||
|
||
RUN --mount=type=cache,target=./target \ | ||
mv ./target/debug/ping /usr/local/bin/testplan | ||
mv ./target/release/ping /usr/local/bin/testplan | ||
|
||
FROM gcr.io/distroless/cc | ||
COPY --from=builder /usr/local/bin/testplan /usr/local/bin/testplan | ||
COPY --from=builder /dpkg / | ||
ENV RUST_BACKTRACE=1 | ||
ENTRYPOINT ["testplan"] |