Skip to content

Commit

Permalink
ci: reduce size of Rust interop-test image
Browse files Browse the repository at this point in the history
This is an automatic backport of pull request #3926 done by [Mergify](https://mergify.com).

Pull-Request: #3945.
  • Loading branch information
mergify[bot] authored May 15, 2023
1 parent 2d9ae38 commit 8c26c61
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions interop-tests/Dockerfile
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"]

0 comments on commit 8c26c61

Please sign in to comment.