I'm trying to deploy a rust server using docker, but when I try to run the container docker run myapp
I get the following error: myapp: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
.
Here is my Dockerfile:
FROM rust:latest as builder
WORKDIR /usr/src/myapp
COPY . .
RUN cargo install --path .
FROM debian:bullseye
FROM postgres:latest
ENV POSTGRES_USER user
ENV POSTGRES_DB db
RUN apt-get update \
&& apt-get install -y libssl-dev \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/cargo/bin/myapp /usr/local/bin/myapp
CMD ["myapp"]
I'm new to Docker and would appreciate your help.
So far I have tried:
- Changing the debian base image from
bullseye
tobullseye-slim
orlatest
- Linking
/usr/local/lib/libssl.so.1.1
to/usr/lib64/libssl.so.1.1