Closed azzamsa closed 11 months ago
That library is dynamically linked, therefore you need to install it in both your build stage and your runtime stage!
Worked.
I removed any code that depends on openssl
:
# Database
-sqlx = { version = "0.7.1", features = ["runtime-tokio-native-tls", "postgres", "uuid", "chrono", "migrate"] }
+sqlx = { version = "0.7.1", features = ["runtime-tokio-rustls", "postgres", "uuid", "chrono", "migrate"] }
# Logging
tracing = "0.1.37"
ARG VCS_REVISION
-FROM docker.io/lukemathwalker/cargo-chef:latest-rust-1.71.0 as chef
+FROM docker.io/lukemathwalker/cargo-chef:latest-rust-1 as chef
WORKDIR app
FROM chef as planner
@@ -18,6 +18,6 @@ COPY . .
ARG VCS_REVISION
RUN VCS_REVISION=$VCS_REVISION cargo build --release
-FROM gcr.io/distroless/cc-debian11
+FROM gcr.io/distroless/cc-debian12
COPY --from=builder /app/target/release/tin /
CMD ["./tin"]
By the way, I am still curious why changing the Rust version number on cargo-chef image breaks openssl
related things?
The underlying Linux image has likely changed since we used a newer Rust base image and they stopped bundling the library.
Hi.
My Previous Dockerfile works fine.
But changing it to the newest version gives me
./tin: error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory
I have added these lines, but the error persists.
So, where should I add the
pkg-config libssl-dev
?Thank you! :1st_place_medal:
Related: