mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
69c3011633
<!-- The PR description should answer 2 important questions: --> ### What Upgrade to [Rust 1.80.0](https://blog.rust-lang.org/2024/07/25/Rust-1.80.0.html) ### How Update `rust-toolchain.yaml` and Dockerfiles, fix warnings. V3_GIT_ORIGIN_REV_ID: ba797e1aba6b9623a921734473a6b70a2a38c8b7
40 lines
1.1 KiB
Docker
40 lines
1.1 KiB
Docker
# This should match the Rust version in rust-toolchain.yaml and the other Dockerfiles.
|
|
FROM rust:1.80.0
|
|
|
|
WORKDIR app
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN set -ex;\
|
|
apt-get update; \
|
|
apt-get install --no-install-recommends --assume-yes \
|
|
curl git jq pkg-config ssh \
|
|
libssl-dev lld protobuf-compiler
|
|
|
|
# Set up a directory to store Cargo files.
|
|
ENV CARGO_HOME=/app/.cargo
|
|
ENV PATH="$PATH:$CARGO_HOME/bin"
|
|
# Switch to `lld` as the linker.
|
|
ENV RUSTFLAGS="-C link-arg=-fuse-ld=lld"
|
|
# Building with build.rs requires the Git context to be available across volumes.
|
|
ENV GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
|
|
|
# Install Rust tools.
|
|
COPY rust-toolchain.toml .
|
|
RUN rustup show
|
|
|
|
COPY Cargo.toml Cargo.lock .
|
|
|
|
RUN mkdir bin
|
|
|
|
# Build the binaries and tests
|
|
RUN --mount=type=cache,target=/app/.cargo/git --mount=type=cache,target=/app/.cargo/registry \
|
|
--mount=type=cache,target=./target \
|
|
--mount=type=bind,source=./crates,target=./crates \
|
|
set -ex; \
|
|
cargo build --bin custom-connector
|
|
|
|
# Copy the binaries out of the cache
|
|
RUN --mount=type=cache,target=./target \
|
|
find target/debug -maxdepth 1 -type f -executable -exec cp '{}' bin \;
|