Compile Rust app for a Docker image

Hello,

I need a Docker image based on Ubuntu 22.04 with my own app in it that I wrote in Rust.

Unfortunately, when I try to build my app using the official Rust image, I get a binary that does not run on Ubuntu 22.04 (apparently, then my app wants libssl 1.1, but Ubuntu 22.04 has libssl 3). I also tried to install Rust inside Docker on Ubuntu 22.04, but that needs to happen non-interactively, and Rustup is interactive.

What is the recommended way? Thanks!

Best, Oliver

You can use something like curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.61.0 -y to install rustup and immediately make it install rust 1.61.0 non-interactively I think.

Thanks, that worked!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.