mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-14 11:51:19 +00:00
As mentioned in #4444, we need to include https://github.com/mxinden/libp2p-lookup/ in the image so that we can enable a healthcheck when it starts up. Pull-Request: #4466.
21 lines
693 B
Docker
21 lines
693 B
Docker
FROM rust:1.72-bullseye as builder
|
|
WORKDIR /usr/src/rust-libp2p-server
|
|
|
|
# Run with access to the target cache to speed up builds
|
|
WORKDIR /workspace
|
|
|
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
|
cargo install --locked --root /usr/local libp2p-lookup --version 0.6.4
|
|
|
|
ADD . .
|
|
RUN --mount=type=cache,target=./target \
|
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
|
cargo build --release --package libp2p-server
|
|
|
|
RUN --mount=type=cache,target=./target \
|
|
mv ./target/release/libp2p-server /usr/local/bin/libp2p-server
|
|
|
|
FROM gcr.io/distroless/cc
|
|
COPY --from=builder /usr/local/bin/libp2p-server /usr/local/bin/libp2p-lookup /usr/local/bin/
|
|
CMD ["libp2p-server"]
|