This commit is contained in:
parent
012678a8a7
commit
ab98010224
26
Dockerfile
26
Dockerfile
|
@ -1,18 +1,14 @@
|
||||||
# Use a specific Rust version that is compatible with your dependencies
|
# Use Debian-based Rust image instead of Alpine
|
||||||
FROM rust:alpine AS build
|
FROM rust:slim-bookworm AS build
|
||||||
|
|
||||||
# Print system information for debugging
|
|
||||||
RUN uname -a
|
|
||||||
RUN cat /etc/os-release
|
|
||||||
|
|
||||||
# Install necessary packages
|
# Install necessary packages
|
||||||
RUN apk update && \
|
RUN apt-get update && \
|
||||||
apk add git pkgconf make g++ openssl openssl-dev libheif libheif-dev tiff tiff-dev \
|
apt-get install -y git pkg-config make g++ libssl-dev libheif-dev libtiff-dev \
|
||||||
clang clang-dev llvm-dev llvm-static musl-dev && \
|
clang libclang-dev && \
|
||||||
rustup target add x86_64-unknown-linux-musl
|
rustup target add x86_64-unknown-linux-gnu
|
||||||
|
|
||||||
# Set environment variables for libclang
|
# Set environment variables for libclang
|
||||||
ENV LIBCLANG_PATH=/usr/lib
|
ENV LIBCLANG_PATH=/usr/lib/llvm-14/lib
|
||||||
ENV BINDGEN_EXTRA_CLANG_ARGS="-I/usr/include"
|
ENV BINDGEN_EXTRA_CLANG_ARGS="-I/usr/include"
|
||||||
|
|
||||||
# Create a new Rust binary project
|
# Create a new Rust binary project
|
||||||
|
@ -36,14 +32,16 @@ COPY ./src ./src
|
||||||
# Build the application for release
|
# Build the application for release
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
|
|
||||||
# Use a minimal runtime image for the final stage
|
# Use Debian slim for the final stage
|
||||||
FROM alpine:latest
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
ENV RUST_BACKTRACE=full
|
ENV RUST_BACKTRACE=full
|
||||||
ENV RUST_LOG=warn
|
ENV RUST_LOG=warn
|
||||||
|
|
||||||
# Install runtime dependencies
|
# Install runtime dependencies
|
||||||
RUN apk update && apk add --no-cache openssl libheif tiff
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends libssl3 libheif1 libtiff5 && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy the compiled binary from the build stage
|
# Copy the compiled binary from the build stage
|
||||||
COPY --from=build /quoter/target/release/quoter .
|
COPY --from=build /quoter/target/release/quoter .
|
||||||
|
|
Loading…
Reference in New Issue
Block a user