From a27e84dd71a3f1d964ea11d51871ec8706825ea63d03d2a6bf523e71ed0c571e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Tue, 11 Jun 2024 17:35:34 +0000 Subject: [PATCH] [info=8e5613767510157014bfa600865058dd] OBS-URL: https://build.opensuse.org/package/show/devel:BCI:Tumbleweed/rust-oldstable-image?expand=0&rev=96 --- README.md | 46 ++++++++++++++++++++++++++++++++++-- rust-oldstable-image.changes | 5 ++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ee77610..6c85cb3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,49 @@ -# The openSUSE Tumbleweed BCI Rust 1.77 Container Image +# Rust 1.77 Container Image + ![Redistributable](https://img.shields.io/badge/Redistributable-Yes-green) -Rust 1.77 container based on the openSUSE Tumbleweed Base Container Image. +## Description + +[Rust](https://www.rust-lang.org/) is a systems programming language sponsored by Mozilla Research. It is designed to be a safe, concurrent, practical language, supporting functional and imperative-procedural paradigms. While syntactically similar to C++, Rust is designed for better memory safety without performance penalty. + +## Usage + +To compile and deploy an application, copy the sources, fetch dependencies, and build the binary: + +```Dockerfile +# Build the application using the Rust 1.77 container image +FROM registry.opensuse.org/opensuse/bci/rust:1.77 as build + +WORKDIR /app + +COPY . ./ + +RUN cargo build --release + +# Bundle the application into a BCI micro (or other BCI image) +FROM registry.suse.com/bci/bci-micro + +COPY --from=build /app/target/release/hello /usr/local/bin/hello + +CMD ["hello"] +``` + +Build and run the container image: + +```ShellSession +$ podman build -t my-rust-app . +$ podman run -it --rm my-rust-app +``` + +There are situations, where you don't want to run an application inside a container. + +To compile the application, without running it inside a container instance, use the following command: + +```ShellSession +$ podman run --rm -v "$PWD":/app:Z -w /app registry.opensuse.org/opensuse/bci/rust:1.77 cargo build --release +``` + +**Note:** The Rust image is intended to be used as a build environment. For runtime, use smaller images such as `bci-base`, `bci-micro`, or `bci-minimal`. ## Licensing diff --git a/rust-oldstable-image.changes b/rust-oldstable-image.changes index 485fe55..5a08e51 100644 --- a/rust-oldstable-image.changes +++ b/rust-oldstable-image.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jun 11 17:30:19 UTC 2024 - Alexandre Vicenzi + +- better README for rust images + ------------------------------------------------------------------- Mon Jun 10 15:11:25 UTC 2024 - Dirk Mueller