FROM ghcr.io/osgeo/gdal:ubuntu-full-3.9.2
RUN apt-get update -y
RUN apt-get install -y binutils curl pkg-config gcc
RUN curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain stable --component rust-src -y
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
COPY src ./src/
RUN ~/.cargo/bin/cargo build --release

FROM ghcr.io/osgeo/gdal:ubuntu-full-3.9.2
COPY --from=0 /app/target/release/erdy /usr/local/bin/
